summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/error')
-rw-r--r--dhall/src/error/builder.rs5
1 files changed, 3 insertions, 2 deletions
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)
}
}