I feel like I’ve seen an insane number of error messages in various apps and websites around the unwrap method.
I suspect this is related to LLM usage somehow. We’ll probably see a lot more of this type of problem (sudden flareups of a particular bad code implementation)
SethranKada@lemmy.ca 21 hours ago
There is a function that does what you are asking for.
.unarap_or()
It either unwraps the value or uses a provided default. Personally, i think unwrap() should be renamed unwrap_or_panic() to follow existing conventions and prevent confusion for non-rust programmers.
Noja@sopuli.xyz 20 hours ago
I don’t think non-rust programmers are programming in Rust, LLMs on the other hand…
hummingbird@lemmy.world 6 hours ago
If you think only llms can do these kind of beginner mistakes you are mistaken. That’s the whole point of the argument.