diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-21 11:36:40 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:01 +0300 |
commit | 56d09f8d182eb0b737213311475e9f9a53984bac (patch) | |
tree | 68c43d4639513649862b7e24b839f10e57e0cfa0 /openpgp/src/types/key_flags.rs | |
parent | eec7b10558fd07a0cbcf04e1734bccea96335d4b (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 'openpgp/src/types/key_flags.rs')
-rw-r--r-- | openpgp/src/types/key_flags.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/types/key_flags.rs b/openpgp/src/types/key_flags.rs index 819d4974..292afb6a 100644 --- a/openpgp/src/types/key_flags.rs +++ b/openpgp/src/types/key_flags.rs @@ -137,7 +137,7 @@ impl BitOr for &KeyFlags { let mut l = l.to_vec(); for (i, r) in r.into_iter().enumerate() { - l[i] = l[i] | r; + l[i] |= r; } KeyFlags(l.into()) |