|
|
|
|
|
by nindalf
1504 days ago
|
|
> Go to github and find one Rust repo which doesn't use unwrap excessively. Consider serde-json, a widely used library to serialise and deserialise json. You asked me to find “one Rust repo”. Ok here it is - https://github.com/serde-rs/json/search?q=unwrap&type=. Of the 22 uses of unwrap, nearly all are in test code or in comments. Of the remaining 3 or 4, they seem safe to me. But maybe they’re not. Could you think of some json input that could trigger a panic from one of those unwraps? I’ll put my money where my mouth is. I’ll donate $100 to a charity of your choice if you can find that. But if you can’t, at least have the honesty to admit that you misspoke when you said not even a single repo without “excessive” use of unwraps exists. |
|