Skip to content

Commit

Permalink
Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Oct 10, 2024
1 parent ca06640 commit d674006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jaq-core/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ impl<'s, F> Compiler<&'s str, F> {
let proj = proj.map(|p| self.with(Local::Var(x), |c| c.iterm(p)));
Term::Foreach(xs, init, update, proj)
}
_ => return self.fail(name, Undefined::Filter(arity)),
_ => self.fail(name, Undefined::Filter(arity)),
}
}
BinOp(l, op, r) => {
Expand Down
4 changes: 2 additions & 2 deletions jaq-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl jaq_core::ValT for Val {
};
match o.entry(Rc::clone(i)) {
Occupied(mut e) => {
let v = core::mem::replace(e.get_mut(), Self::default());
let v = core::mem::take(e.get_mut());
match f(v).next().transpose()? {
Some(y) => e.insert(y),
// this runs in constant time, at the price of
Expand All @@ -215,7 +215,7 @@ impl jaq_core::ValT for Val {
Err(e) => return opt.fail(self, |_| Exn::from(e)),
};

let x = core::mem::replace(&mut a[i], Self::default());
let x = core::mem::take(&mut a[i]);
if let Some(y) = f(x).next().transpose()? {
a[i] = y;
} else {
Expand Down

0 comments on commit d674006

Please sign in to comment.