diff options
author | Alice Ryhl <[email protected]> | 2023-05-02 12:40:15 +0000 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2023-05-31 18:53:10 +0200 |
commit | 4a59081c09cbfe17505baf3db50ebb9b97290bae (patch) | |
tree | e6fa3f0dc0f650ba8be998ed47ad41ddbd2de6a8 /rust/kernel/init.rs | |
parent | 309786c2393c7b3375c232b137e52613c8099327 (diff) |
rust: error: allow specifying error type on `Result`
Currently, if the `kernel::error::Result` type is in scope (which is
often is, since it's in the kernel's prelude), you cannot write
`Result<T, SomeOtherErrorType>` when you want to use a different error
type than `kernel::error::Error`.
To solve this we change the error type from being hard-coded to just
being a default generic parameter. This still lets you write `Result<T>`
when you just want to use the `Error` error type, but also lets you
write `Result<T, SomeOtherErrorType>` when necessary.
Signed-off-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Asahi Lina <[email protected]>
Reviewed-by: Andreas Hindborg <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/kernel/init.rs')
0 files changed, 0 insertions, 0 deletions