rust: error: improve `to_result` documentation
authorMiguel Ojeda <ojeda@kernel.org>
Fri, 29 Aug 2025 19:22:42 +0000 (21:22 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Sep 2025 22:10:10 +0000 (00:10 +0200)
commit099381a08db3539c6aab6616c94d7950d74fcd2d
treefc70474910283635a7f962bf6b36035660e68525
parent58b4aa53606f75c7d6e6cd4710da4d4399e8f667
rust: error: improve `to_result` documentation

Core functions like `to_result` should have good documentation.

Thus improve it, including adding an example of how to perform early
returns with it.

Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/error.rs