News for hackers. Stuff that matters.
Re:Rust: Enums to Wrap Multiple Errors by OJFord on Friday October 08, 2021 @03:02PM (#28802825)
Thanks!

> To my knowledge, thiserror doesn't allow you to take an `io::Error` and sort it into two different enum variants (like the `Reading` and `Opening` variants in my grandparent example)

Indeed that does look nice, I don't know for sure either, I'm only very basically using it. (Which is where it's been a bit of a pain at times - to be honest for where I've been using it so far I just wanted a dead simple 'I really don't care just return the basic error message in some way that compiles'.)

> The author of those crates is a giant in the Rust community [dtolnay]

For what it's worth, I haven't conducted any sort of objective metric-based comparison obviously, but I recognise both of your usernames equally as giants. ;)

> You should [get autocompletion on *Snafu], at least if you use rust-analyzer

Oh, clever. "[rust-analyzer] is a part of a larger rls-2.0 effort to create excellent IDE support for Rust." I'll have to check, but I'm pretty sure I'm using 'rls-1.0' (in vim).

There are no comments on this comment yet.