rust: alloc: align Debug implementation for Box with Display
authorGuangbo Cui <2407018371@qq.com>
Mon, 11 Nov 2024 13:51:27 +0000 (21:51 +0800)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 17 Dec 2024 23:56:05 +0000 (00:56 +0100)
Ensure consistency between `Debug` and `Display` for `Box` by
updating `Debug` to match the new `Display` style.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Guangbo Cui <2407018371@qq.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/tencent_1FC0BC283DA65DD81A8A14EEF25563934E05@qq.com
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc/kbox.rs

index 6beb976580262e3dd5ccfecaaaf61f4bbcbecccf..19e227351918ab5e2598b2b9c6e7f9ea5cdd818c 100644 (file)
@@ -443,7 +443,7 @@ where
     A: Allocator,
 {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        fmt::Debug::fmt(&**self, f)
+        <T as fmt::Debug>::fmt(&**self, f)
     }
 }