mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
dogfood
This commit is contained in:
+20
-23
@@ -149,29 +149,26 @@ fn recurse(brackets: bool, cx: &LateContext, suggestion: &Bool, terminals: &[&Ex
|
||||
recurse(true, cx, inner, terminals, s)
|
||||
},
|
||||
Term(n) => {
|
||||
match terminals[n as usize].node {
|
||||
ExprBinary(binop, ref lhs, ref rhs) => {
|
||||
let op = match binop.node {
|
||||
BiEq => " != ",
|
||||
BiNe => " == ",
|
||||
BiLt => " >= ",
|
||||
BiGt => " <= ",
|
||||
BiLe => " > ",
|
||||
BiGe => " < ",
|
||||
_ => {
|
||||
s.push('!');
|
||||
return recurse(true, cx, inner, terminals, s)
|
||||
},
|
||||
};
|
||||
s.push_str(&snip(lhs));
|
||||
s.push_str(op);
|
||||
s.push_str(&snip(rhs));
|
||||
s
|
||||
},
|
||||
_ => {
|
||||
s.push('!');
|
||||
recurse(false, cx, inner, terminals, s)
|
||||
},
|
||||
if let ExprBinary(binop, ref lhs, ref rhs) = terminals[n as usize].node {
|
||||
let op = match binop.node {
|
||||
BiEq => " != ",
|
||||
BiNe => " == ",
|
||||
BiLt => " >= ",
|
||||
BiGt => " <= ",
|
||||
BiLe => " > ",
|
||||
BiGe => " < ",
|
||||
_ => {
|
||||
s.push('!');
|
||||
return recurse(true, cx, inner, terminals, s)
|
||||
},
|
||||
};
|
||||
s.push_str(&snip(lhs));
|
||||
s.push_str(op);
|
||||
s.push_str(&snip(rhs));
|
||||
s
|
||||
} else {
|
||||
s.push('!');
|
||||
recurse(false, cx, inner, terminals, s)
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user