rust: sync: change error type of constructor functions
authorBenno Lossin <benno.lossin@proton.me>
Sat, 8 Apr 2023 12:25:29 +0000 (12:25 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 12 Apr 2023 16:41:05 +0000 (18:41 +0200)
commitd6dbca3592209d29c10e171224c34803805e88ca
tree12bd06587d811debc295c81cdf1c0befa76d4f93
parent70a21e54a42232f1056db7f05a194f56e03e7d3e
rust: sync: change error type of constructor functions

Change the error type of the constructors of `Arc` and `UniqueArc` to be
`AllocError` instead of `Error`. This makes the API more clear as to
what can go wrong when calling `try_new` or its variants.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20230408122429.1103522-4-y86-dev@protonmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/sync/arc.rs