summaryrefslogtreecommitdiffstats
path: root/buffered-reader
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-21 11:36:40 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:01 +0300
commit56d09f8d182eb0b737213311475e9f9a53984bac (patch)
tree68c43d4639513649862b7e24b839f10e57e0cfa0 /buffered-reader
parenteec7b10558fd07a0cbcf04e1734bccea96335d4b (diff)
Use a clearer and shorter += or /= operation
Rewrite: i = i + 1 as i += 1 For a simple variable this is shorter, and a little bit clearer. For more complex expressions it avoids making the reader having to visually check that the left and right hand side of the assignment really do have the same expression and that nothing tricky is going on. This was found by the clippy lint assign_op_pattern: https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
Diffstat (limited to 'buffered-reader')
-rw-r--r--buffered-reader/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffered-reader/src/lib.rs b/buffered-reader/src/lib.rs
index 918b7268..1ee7514b 100644
--- a/buffered-reader/src/lib.rs
+++ b/buffered-reader/src/lib.rs
@@ -834,7 +834,7 @@ pub trait BufferedReader<C> : io::Read + fmt::Debug + fmt::Display + Send + Sync
writeln!(sink, " {}. {}, {:?}", i, r, cookie)?;
}
reader = r.get_ref();
- i = i + 1;
+ i += 1;
}
Ok(())
}