summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Barvíř <barvirm@gmail.com>2023-04-18 11:19:09 +0200
committerGitHub <noreply@github.com>2023-04-18 11:19:09 +0200
commit56673bcdf5a8be0f89a3781a5ce392736823dc44 (patch)
tree03cbe32d6b1334bc17639b15f91b6d81b6a6e594 /src
parent213502721961854b30a4971b0197495145fbbc75 (diff)
Clippy fixes (#856)
Diffstat (limited to 'src')
-rw-r--r--src/eval/mod.rs2
-rw-r--r--src/lib.rs1
-rw-r--r--src/syntax/ast.rs2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index b8220112..797e1fef 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -1203,7 +1203,7 @@ impl ast::Pattern {
return None;
};
if let Some(ident) = ident {
- vm.define(ident.clone(), sink);
+ vm.define(ident, sink);
}
i += sink_size as i64;
Some(())
diff --git a/src/lib.rs b/src/lib.rs
index 392bd7ac..744013ce 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,4 @@
+#![allow(clippy::comparison_chain)]
//! The compiler for the _Typst_ markup language.
//!
//! # Steps
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 3c01bdff..caf5319f 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -1625,7 +1625,7 @@ impl Destructuring {
// Returns a list of all identifiers in the pattern.
pub fn idents(&self) -> impl Iterator<Item = Ident> + '_ {
- self.bindings().into_iter().filter_map(|binding| match binding {
+ self.bindings().filter_map(|binding| match binding {
DestructuringKind::Ident(ident) => Some(ident),
DestructuringKind::Sink(ident) => ident,
DestructuringKind::Named(_, ident) => Some(ident),