Fix clippyisms

This commit is contained in:
Tony Garnock-Jones 2019-10-24 14:50:32 +01:00
parent 85db5e3710
commit e730b22f6d
1 changed files with 7 additions and 9 deletions

View File

@ -132,7 +132,7 @@ impl Index {
|l, v| { l.cached_assertions.insert(v.clone()); }, |l, v| { l.cached_assertions.insert(v.clone()); },
|es, cs| { |es, cs| {
if es.cached_captures.change(cs.clone(), 1) == bag::Net::AbsentToPresent { if es.cached_captures.change(cs.clone(), 1) == bag::Net::AbsentToPresent {
outputs.push((es.endpoints.iter().cloned().collect(), cs.clone())) outputs.push((es.endpoints.iter().cloned().collect(), cs))
} }
}) })
.perform(&mut self.root); .perform(&mut self.root);
@ -145,7 +145,7 @@ impl Index {
|l, v| { l.cached_assertions.remove(v); }, |l, v| { l.cached_assertions.remove(v); },
|es, cs| { |es, cs| {
if es.cached_captures.change(cs.clone(), -1) == bag::Net::PresentToAbsent { if es.cached_captures.change(cs.clone(), -1) == bag::Net::PresentToAbsent {
outputs.push((es.endpoints.iter().cloned().collect(), cs.clone())) outputs.push((es.endpoints.iter().cloned().collect(), cs))
} }
}) })
.perform(&mut self.root); .perform(&mut self.root);
@ -162,7 +162,7 @@ impl Index {
&outer_value, &outer_value,
|_c, _v| (), |_c, _v| (),
|_l, _v| (), |_l, _v| (),
|es, cs| outputs.push((es.endpoints.iter().cloned().collect(), cs.clone()))) |es, cs| outputs.push((es.endpoints.iter().cloned().collect(), cs)))
.perform(&mut self.root); .perform(&mut self.root);
outputs outputs
} }
@ -514,7 +514,7 @@ impl Analyzer {
} }
if a.value().is_simple_record("Discard", Some(0)) { if a.value().is_simple_record("Discard", Some(0)) {
return Skeleton::Blank; Skeleton::Blank
} else { } else {
match class_of(a) { match class_of(a) {
Some(cls) => { Some(cls) => {
@ -554,11 +554,9 @@ fn instantiate_assertion_walk(capture_paths: &mut Paths,
capture_paths.push(path.clone()); capture_paths.push(path.clone());
let v = vs.pop().unwrap(); let v = vs.pop().unwrap();
instantiate_assertion_walk(capture_paths, path, vs, &fields[0]); instantiate_assertion_walk(capture_paths, path, vs, &fields[0]);
return v; v
} } else if a.value().is_simple_record("Discard", Some(0)) {
Value::Domain(Syndicate::new_placeholder()).wrap()
if a.value().is_simple_record("Discard", Some(0)) {
return Value::Domain(Syndicate::new_placeholder()).wrap();
} else { } else {
let f = |(i, aa)| { let f = |(i, aa)| {
path.push(i); path.push(i);