mirror of
https://github.com/rust-lang/rust.git
synced 2026-03-13 21:32:36 +00:00
remove empty wraps, don't return Results from from infallible functions This makes code easier to understand because it is more obvious when a function actually can't fail (return Err or None) Make functions that only ever return Some(x), return x directly Remove return type from functions that return Option<(), Err> but would only ever return Ok(()). Found with `clippy::unnecessary_wraps`
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.