From: Ian Jackson Date: Sun, 2 May 2021 20:54:27 +0000 (+0100) Subject: bundles: Provide Display for Id X-Git-Tag: otter-0.6.0~469 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fe5fd706dbd6aceb344484c6b5aedbb8e2750ceb;p=otter.git bundles: Provide Display for Id Nothing uses this yet but maybe it will be useful. Signed-off-by: Ian Jackson --- diff --git a/src/bundles.rs b/src/bundles.rs index 948aca7e..b9c56bfd 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -88,6 +88,13 @@ where S: Display + Debug index, suffix) } +impl Display for Id { + #[throws(fmt::Error)] + fn fmt(&self, f: &mut fmt::Formatter) { + write!(f, "{}.{}", self.index, self.kind)? + } +} + impl Id { fn path_tmp(&self, instance: &InstanceName) -> String { b_file(instance, self.index, "tmp")