618
submitted 11 months ago by jroid8@lemmy.world to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] xor@lemmy.blahaj.zone 10 points 11 months ago

The original example was doing the unwrap_within an iterator doing some string parsing, so there was a lot of unrelated boilerplate around the actual unwrapping that made it really unclear, as well as usual unwrap_or_else to produce a constant value

Ehhh, I was more using get_default as a placeholder for some function, as opposed to representing Default::default for the inner type specifically. I think it should be alright since only people familiar with rust would know about the default trait anyway. I did consider adding an unwrap_or_default example, but thought it was getting a bit off topic at that point.

[-] Username@feddit.de 4 points 11 months ago

Yeah I get it, it was just something I noticed. A pedantic lint, you could say.

[-] xor@lemmy.blahaj.zone 1 points 11 months ago
this post was submitted on 08 Dec 2023
618 points (96.4% liked)

Programmer Humor

32371 readers
568 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS