]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: error: extend the Result documentation
authorDirk Behme <dirk.behme@de.bosch.com>
Wed, 22 Jan 2025 05:47:19 +0000 (06:47 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 16 Mar 2025 19:54:08 +0000 (20:54 +0100)
commitdc60dd0c688e794fefb6b3de8552b3c9452f812e
tree68534d49398ded6ab577b89801e3ad555e67b52e
parentab2ebb7bc9d9af2f50b0ad54deb65e1d0b01bc70
rust: error: extend the Result documentation

Extend the Result documentation by some guidelines and examples how
to handle Result error cases gracefully. And how to not handle them.

While at it fix one missing `Result` link in the existing documentation.

[ Moved links out-of-line for improved readability. Fixed `srctree`
  link. Sorted out-of-line links. Added newlines for consistency
  with other docs. Applied paragraph break suggestion. Reworded
  slightly the docs in a couple places. Added Markdown.

  In addition, added `#[allow(clippy::single_match)` for the first
  example. It cannot be an `expect` since due to a difference introduced
  in Rust 1.85.0 when there are comments in the arms of the `match`.
  Reported it upstream, but it was intended:

      https://github.com/rust-lang/rust-clippy/issues/14418

  Perhaps Clippy will lint about it in the future, but without autofix:

      https://github.com/rust-lang/rust-clippy/pull/14420

    - Miguel ]

Link: https://lore.kernel.org/rust-for-linux/CANiq72keOdXy0LFKk9SzYWwSjiD710v=hQO4xi+5E4xNALa6cA@mail.gmail.com/
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Link: https://lore.kernel.org/r/20250122054719.595878-1-dirk.behme@de.bosch.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/error.rs