mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Ran cargo dev fmt
This commit is contained in:
parent
f8e949fa1c
commit
fe342f3291
@ -420,11 +420,7 @@ fn is_zero(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool {
|
||||
/// one of the two expressions
|
||||
/// If the two expressions are not negations of each other, then it
|
||||
/// returns None.
|
||||
fn are_negated<'a>(
|
||||
cx: &LateContext<'_, '_>,
|
||||
expr1: &'a Expr<'a>,
|
||||
expr2: &'a Expr<'a>,
|
||||
) -> Option<(bool, &'a Expr<'a>)> {
|
||||
fn are_negated<'a>(cx: &LateContext<'_, '_>, expr1: &'a Expr<'a>, expr2: &'a Expr<'a>) -> Option<(bool, &'a Expr<'a>)> {
|
||||
if let ExprKind::Unary(UnOp::UnNeg, expr1_negated) = &expr1.kind {
|
||||
if are_exprs_equal(cx, expr1_negated, expr2) {
|
||||
return Some((false, expr2));
|
||||
|
@ -112,15 +112,15 @@ fn not_fake_abs5(a: A) -> f64 {
|
||||
fn main() {
|
||||
fake_abs1(5.0);
|
||||
fake_abs2(5.0);
|
||||
fake_abs3(A { a: 5.0, b: 5.0 } );
|
||||
fake_abs3(A { a: 5.0, b: 5.0 });
|
||||
fake_abs4(5.0);
|
||||
fake_abs5(A { a: 5.0, b: 5.0 } );
|
||||
fake_abs5(A { a: 5.0, b: 5.0 });
|
||||
fake_nabs1(5.0);
|
||||
fake_nabs2(5.0);
|
||||
fake_nabs3(A { a: 5.0, b: 5.0 } );
|
||||
fake_nabs3(A { a: 5.0, b: 5.0 });
|
||||
not_fake_abs1(5.0);
|
||||
not_fake_abs2(5.0);
|
||||
not_fake_abs3(5.0, 5.0);
|
||||
not_fake_abs4(A { a: 5.0, b: 5.0 } );
|
||||
not_fake_abs5(A { a: 5.0, b: 5.0 } );
|
||||
not_fake_abs4(A { a: 5.0, b: 5.0 });
|
||||
not_fake_abs5(A { a: 5.0, b: 5.0 });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user