Commit e3d1dff3 authored by Jeff Smits's avatar Jeff Smits

The amount of type annotations on collects makes me want to cry

parent 1498e079
This diff is collapsed.
......@@ -59,7 +59,6 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
result
}
// Should really return a &SDef, but I can't figure out lifetimes that borrowck will accept :(
pub fn get_strategy(&self, strat_name: &str) -> Result<StrategyDef<'d, 'f>> {
self.scopes
.borrow()
......
......@@ -421,14 +421,15 @@ impl<'a> ATermWrite for Strategy<'a> {
write!(writer, "{}", str::repeat(")", pairs.len()))
}
Strategy::ConsMatch(ref map, ref final_else) => {
let strat = map.values().fold(final_else.clone(), |else_strat, glc| {
match *glc {
let strat = map.values().fold(
final_else.clone(),
|else_strat, glc| match *glc {
Strategy::GuardedLChoice(ref pairs, _) => {
Rc::new(Strategy::GuardedLChoice(pairs.clone(), else_strat))
}
_ => unreachable!("ConsMatch should have GuardedLChoices"),
}
});
},
);
strat.to_ascii(writer)
}
Strategy::PrimT(name, ref sargs, ref targs) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment