« first day (2328 days earlier)      last day (1163 days later) » 

1:06 AM
@JBis doesn't really look bad to me at all
except the part that uses format! to create a path... but the match seems fine
If you're doing that all throughout your code, it might mean that you're panicking too much.
Many functions can return a Result that can be either immediately unwrap/expected or bubbled up with ? to a level where it can be dealt with
 
1:22 AM
@trentcl I tried ? but I may have multiple error types so I'm not sure what to do for the Err type of Result
 
@JBis Start with Box<dyn Error> and see how far that gets you.
You can't easily match on it to figure out what the original error type was, but it works fine for propagating opaque errors and most error types can be automatically converted to it
 
Seems like a bad solution
 
You can make a custom type alias type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; to make your return types less noisy
@JBis Hence "see how far that gets you"
It gets you moving without having to spend a long time figuring out exactly what all errors you're going to have to deal with.
 
Alright thanks
 
When you want to actually start handling errors, that's the time to start looking into libraries. I haven't used any of the newer ones (snafu, anyhow...) so I can't make a recommendation
 
1:39 AM
@trentcl Or learn to design proper error-hierarchies and perhaps use loggers ;)
 
I never learned to do anything the proper way ;)
 
(I wouldn't recommend people to start using libraries when they don't even know what they want a library to do for them.)
 
Fair point
 
 
5 hours later…
6:25 AM
people on SO be like "how can I do this ?":
 
6:43 AM
@Shepmaster Any non trivial case is hard to describe, makes you do a lot of useless repetitions in your code, and many composite conditions can't simply be described. Let's say you want to have dependencies for some target_os but not when some feature is enabled. You can't do this.
 
 
2 hours later…
8:41 AM
2 days ago, by Jason
I've noticed that "[enter image description here]" seems to be a classic among many in the review queue.
I’m glad adding video to one’s question isn’t an option.
Morning! o/
 

« first day (2328 days earlier)      last day (1163 days later) »