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:
376aed8
)
Provide DebugExt::to_debug
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 2 May 2021 22:56:34 +0000
(23:56 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 2 May 2021 23:00:27 +0000
(
00:00
+0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/misc.rs
patch
|
blob
|
history
diff --git
a/base/misc.rs
b/base/misc.rs
index c6bbe0615695b7da051aba6ff427a23d176526e7..faa47bc4018bedb8a34ad7a47f15700ec3e90639 100644
(file)
--- a/
base/misc.rs
+++ b/
base/misc.rs
@@
-84,3
+84,8
@@
macro_rules! if_let {
};
};
}
+
+#[ext(pub, name=DebugExt)]
+impl<T:Debug> T {
+ fn to_debug(&self) -> String { format!("{:?}", self) }
+}