chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40037b0
)
clock: impl Display for User and fix Debug to be debuggy
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 21:40:46 +0000
(21:40 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 21:40:56 +0000
(21:40 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/clock.rs
patch
|
blob
|
history
diff --git
a/src/clock.rs
b/src/clock.rs
index 7f11b4fb5111bbe8cef9b2b2d8b8b596a03b8926..8e3359e18631aa66f8c99c83e282495f812af245 100644
(file)
--- a/
src/clock.rs
+++ b/
src/clock.rs
@@
-39,11
+39,16
@@
const USERINFOS: [UserInfo; N] = [
const USERS: [User; N] = [ User(false), User(true) ];
-impl fmt::D
ebug
for User {
+impl fmt::D
isplay
for User {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_char(USERINFOS[*self].idchar)
}
}
+impl fmt::Debug for User {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "User({})", self)
+ }
+}
#[derive(Debug,Clone,Copy,Error,Serialize,Deserialize)]
struct BadClockUserError;