From fe5fd706dbd6aceb344484c6b5aedbb8e2750ceb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 2 May 2021 21:54:27 +0100 Subject: [PATCH] bundles: Provide Display for Id Nothing uses this yet but maybe it will be useful. Signed-off-by: Ian Jackson --- src/bundles.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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") -- 2.30.2