summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
authorNadrieril2020-03-17 23:01:35 +0000
committerNadrieril2020-03-17 23:14:32 +0000
commitc22e161f7bd97d4f6c063513cc051f6af2683d84 (patch)
tree7ebb20c3e9db1657a731c5871716e82685dcab6d /dhall/src/error
parent681dad33cf27b2be4f4b3cefd83998af1d7eefb2 (diff)
Run clippy
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)
}
}