diff options
| author | Eduard Bopp <eduard.bopp@aepsil0n.de> | 2014-02-18 13:40:25 +0100 |
|---|---|---|
| committer | Eduard Bopp <eduard.bopp@aepsil0n.de> | 2014-02-22 16:32:48 +0100 |
| commit | 9982de6397197a63a093e7b79851d1915ef783d7 (patch) | |
| tree | fb770270ad79bc8936bfab1ae47d044204b2af5e /src/libtest | |
| parent | c48babe546751c6ad252cf7c292394aab693af30 (diff) | |
| download | rust-9982de6397197a63a093e7b79851d1915ef783d7.tar.gz rust-9982de6397197a63a093e7b79851d1915ef783d7.zip | |
Warn about unnecessary parentheses upon assignment
Closes #12366.
Parentheses around assignment statements such as
let mut a = (0);
a = (1);
a += (2);
are not necessary and therefore an unnecessary_parens warning is raised when
statements like this occur.
The warning mechanism was refactored along the way to allow for code reuse
between the routines for checking expressions and statements.
Code had to be adopted throughout the compiler and standard libraries to comply
with this modification of the lint.
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 19c2f80cdbd..eba922ac7b8 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -1047,7 +1047,7 @@ impl MetricMap { let r = match selfmap.find(k) { None => MetricRemoved, Some(v) => { - let delta = (v.value - vold.value); + let delta = v.value - vold.value; let noise = match noise_pct { None => f64::max(vold.noise.abs(), v.noise.abs()), Some(pct) => vold.value * pct / 100.0 |
