diff options
author | Gary Guo <gary@garyguo.net> | 2025-09-04 21:41:38 -0700 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-09-15 09:38:35 +0200 |
commit | 7487645f0b2d1a30590bafa7a977dc6661006d4f (patch) | |
tree | ee25c7b45a11c5b5f1f52c879cdf28dce80e1148 /rust/helpers/helpers.c | |
parent | bb38f35b35f9de0cebc4d62ea73482454e38cef3 (diff) |
rust: make `Arc::into_unique_or_drop` associated function
Make `Arc::into_unique_or_drop` to become a mere associated function
instead of a method (i.e. removing the `self` receiver).
It's a general convention for Rust smart pointers to avoid having
methods defined on them, because if the pointee type has a method of the
same name, then it is shadowed. This is normally for avoiding semver
breakage, which isn't an issue for kernel codebase, but it's still
generally a good practice to follow this rule, so that `ptr.foo()` would
always be calling a method on the pointee type.
Signed-off-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Link: https://lore.kernel.org/r/20250723233312.3304339-3-gary@kernel.org
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions