chiark / gitweb /
Rename BadClockUserError so we can reuse it
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Mar 2021 00:20:41 +0000 (00:20 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 20:12:41 +0000 (20:12 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/clock.rs

index 3a3ab5fe5c67bf3e8bbc43791a6e0b88a31ef4d9..5be01c6fa5c911f60f41de897e520970d78bc473 100644 (file)
@@ -46,16 +46,16 @@ impl fmt::Debug for User {
 }
 
 #[derive(Debug,Clone,Copy,Error,Serialize,Deserialize)]
-struct UserOutOfRangeError;
-display_as_debug!{UserOutOfRangeError}
+struct BadClockUserError;
+display_as_debug!{BadClockUserError}
 
 impl TryFrom<u8> for User {
-  type Error = UserOutOfRangeError;
-  #[throws(UserOutOfRangeError)]
+  type Error = BadClockUserError;
+  #[throws(BadClockUserError)]
   fn try_from(u: u8) -> User { User(match u {
     0 => false,
     1 => true,
-    _ => throw!(UserOutOfRangeError),
+    _ => throw!(BadClockUserError),
   }) }
 }