diff options
| author | Wedson Almeida Filho <[email protected]> | 2022-11-10 16:41:23 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2022-12-04 00:59:15 +0000 |
| commit | 25d176a4fad5841de1f85d2a4d69ce87416abc26 (patch) | |
| tree | 4f71d85a8a29dc51e08ac08b36b17d57db2df7e5 /rust/alloc/vec/mod.rs | |
| parent | rust: error: add `From` implementations for `Error` (diff) | |
| download | kernel-25d176a4fad5841de1f85d2a4d69ce87416abc26.tar.gz kernel-25d176a4fad5841de1f85d2a4d69ce87416abc26.zip | |
rust: prelude: add `error::code::*` constant items
It is convenient to have all the `Error` constant items (such as
`EINVAL`) available as-is everywhere (i.e. for code using the kernel
prelude such as kernel modules).
Therefore, add all of them to the prelude.
For instance, this allows to write `Err(EINVAL)` to create
a kernel `Result`:
fn f() -> Result<...> {
...
Err(EINVAL)
}
Signed-off-by: Wedson Almeida Filho <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/alloc/vec/mod.rs')
0 files changed, 0 insertions, 0 deletions
