Fixes clippy warning:
warning: all variants have the same postfix: `Init`
  --> rust/kernel/sync/set_once.rs:68:1

Signed-off-by: Alvin Sun <[email protected]>
---
 rust/kernel/sync/set_once.rs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/rust/kernel/sync/set_once.rs b/rust/kernel/sync/set_once.rs
index db9c5423fade3..3af5538aae1d4 100644
--- a/rust/kernel/sync/set_once.rs
+++ b/rust/kernel/sync/set_once.rs
@@ -67,17 +67,17 @@ fn default() -> Self {
 #[derive(Debug)]
 pub enum InitError<E> {
     /// The `Once` has already been initialized.
-    AlreadyInit,
+    Already,
     /// The `Once` is being raced to initialize by another thread.
-    RacedInit,
+    Raced,
     /// Error occurs during initialization.
-    DuringInit(E),
+    Inner(E),
 }
 
 impl<E> From<E> for InitError<E> {
     #[inline]
     fn from(err: E) -> Self {
-        InitError::DuringInit(err)
+        InitError::Inner(err)
     }
 }
 
@@ -85,9 +85,9 @@ impl<E: Into<Error>> From<InitError<E>> for Error {
     #[inline]
     fn from(this: InitError<E>) -> Self {
         match this {
-            InitError::AlreadyInit => EEXIST,
-            InitError::RacedInit => EBUSY,
-            InitError::DuringInit(e) => e.into(),
+            InitError::Already => EEXIST,
+            InitError::Raced => EBUSY,
+            InitError::Inner(e) => e.into(),
         }
     }
 }
@@ -155,8 +155,8 @@ pub fn init<E>(&self, init: impl Init<T, E>) -> Result<&T, 
InitError<E>> {
                     }
                 }
             }
-            Err(1) => Err(InitError::RacedInit),
-            Err(_) => Err(InitError::AlreadyInit),
+            Err(1) => Err(InitError::Raced),
+            Err(_) => Err(InitError::Already),
         }
     }
 

-- 
2.43.0


Reply via email to