From 1bd6e2fc0621d688566453199aa861804c492bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20St=C3=BChn?= Date: Tue, 23 Nov 2021 14:38:06 +0100 Subject: [PATCH] Update impl Display, omit to_string, change wording --- rust-bindings/rust/src/object_details.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/rust-bindings/rust/src/object_details.rs b/rust-bindings/rust/src/object_details.rs index 12a580cb..fcf13d61 100644 --- a/rust-bindings/rust/src/object_details.rs +++ b/rust-bindings/rust/src/object_details.rs @@ -31,18 +31,13 @@ impl ObjectDetails { pub fn appearances(&self) -> &Vec { &self.object_appearances } - - /// Format this `ObjectDetails` as a string. - fn to_string(&self) -> String { - format!("Object is {} loose and appears in {} checksums", - if self.loose {"available"} else {"not available"}, - self.object_appearances.len() ) - } } impl Display for ObjectDetails{ fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { - write!(f, "{}", self.to_string()) + write!(f, "Object is {} and appears in {} checksums", + if self.loose {"loose"} else {"not loose"}, + self.object_appearances.len() ) } }