summaryrefslogtreecommitdiff
path: root/rust/kernel/debugfs/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/debugfs/traits.rs')
-rw-r--r--rust/kernel/debugfs/traits.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/rust/kernel/debugfs/traits.rs b/rust/kernel/debugfs/traits.rs
index 92054fed2136..e8a8a98f18dc 100644
--- a/rust/kernel/debugfs/traits.rs
+++ b/rust/kernel/debugfs/traits.rs
@@ -3,11 +3,11 @@
//! Traits for rendering or updating values exported to DebugFS.
+use crate::fmt;
use crate::prelude::*;
use crate::sync::atomic::{Atomic, AtomicBasicOps, AtomicType, Relaxed};
use crate::sync::Mutex;
use crate::uaccess::UserSliceReader;
-use core::fmt::{self, Debug, Formatter};
use core::str::FromStr;
/// A trait for types that can be written into a string.
@@ -21,17 +21,17 @@ use core::str::FromStr;
/// explicitly instead.
pub trait Writer {
/// Formats the value using the given formatter.
- fn write(&self, f: &mut Formatter<'_>) -> fmt::Result;
+ fn write(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result;
}
impl<T: Writer> Writer for Mutex<T> {
- fn write(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ fn write(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.lock().write(f)
}
}
-impl<T: Debug> Writer for T {
- fn write(&self, f: &mut Formatter<'_>) -> fmt::Result {
+impl<T: fmt::Debug> Writer for T {
+ fn write(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "{self:?}")
}
}