summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-03-17 23:36:12 +0000
committerGitHub2020-03-17 23:36:12 +0000
commit6c18f2b698874d125532625e2bedaa6621962074 (patch)
treedc8eec542bdbbb39bc24b8b43e1abf20490e6702 /dhall/src/error
parent681dad33cf27b2be4f4b3cefd83998af1d7eefb2 (diff)
parent715a941333887c4a29c2c49102bf1455d88a5417 (diff)
Merge pull request #144 from Nadrieril/clippy
Clippy
Diffstat (limited to '')
-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)
}
}