From c22e161f7bd97d4f6c063513cc051f6af2683d84 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 17 Mar 2020 23:01:35 +0000 Subject: Run clippy --- dhall/src/error/builder.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dhall/src/error') diff --git a/dhall/src/error/builder.rs b/dhall/src/error/builder.rs index b4c5073..f444518 100644 --- a/dhall/src/error/builder.rs +++ b/dhall/src/error/builder.rs @@ -116,11 +116,12 @@ impl ErrorBuilder { } // TODO: handle multiple files + #[allow(clippy::drop_ref)] pub fn format(&mut self) -> String { if self.consumed { panic!("tried to format the same ErrorBuilder twice") } - let this = std::mem::replace(self, ErrorBuilder::default()); + let this = std::mem::take(self); self.consumed = true; drop(self); // Get rid of the self reference so we don't use it by mistake. @@ -154,7 +155,7 @@ impl ErrorBuilder { }; let dl = DisplayList::from(snippet); let dlf = DisplayListFormatter::new(true, false); - format!("{}", dlf.format(&dl)) + dlf.format(&dl) } } -- cgit v1.2.3