Skip to content

Commit

Permalink
Update Clippy and fix lints (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Aug 7, 2023
1 parent 9ac864e commit 7bfb327
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.56.0 # MSRV
toolchain: 1.71.0
components: clippy
- run: cargo clippy --all --all-features -- -D warnings

Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cfb-mode/tests/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ fn aes128_cfb_async_test() {
*b = (i % 11) as u8;
}
let enc = Enc::new_from_slices(&key, &iv).unwrap();
let mut ct = pt.clone();
let mut ct = pt;
enc.encrypt(&mut ct);
for i in 1..100 {
let enc = Enc::new_from_slices(&key, &iv).unwrap();
let mut t = pt.clone();
let mut t = pt;
let t = &mut t[..i];
enc.encrypt(t);
assert_eq!(t, &ct[..i]);
Expand Down Expand Up @@ -72,13 +72,13 @@ fn aes128_cfb_buffered_test() {

// unbuffered
let enc = Enc::new_from_slices(&key, &iv).unwrap();
let mut ct = pt.clone();
let mut ct = pt;
enc.encrypt(&mut ct);

// buffered
for i in 1..100 {
let mut buf_enc = BufEnc::new_from_slices(&key, &iv).unwrap();
let mut ct2 = pt.clone();
let mut ct2 = pt;
for chunk in ct2.chunks_mut(i) {
buf_enc.encrypt(chunk);
}
Expand All @@ -94,7 +94,7 @@ fn aes128_cfb_buffered_test() {
// buffered with restore
for i in 1..100 {
let mut buf_enc = BufEnc::new_from_slices(&key, &iv).unwrap();
let mut ct2 = pt.clone();
let mut ct2 = pt;
for chunk in ct2.chunks_mut(i) {
let (iv, pos) = buf_enc.get_state();
let cipher = Aes128::new_from_slice(&key).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions cfb8/tests/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ fn aes128_cfb8_async_test() {
*b = (i % 11) as u8;
}
let enc = Enc::new_from_slices(&key, &iv).unwrap();
let mut ct = pt.clone();
let mut ct = pt;
enc.encrypt(&mut ct);
for i in 1..100 {
let enc = Enc::new_from_slices(&key, &iv).unwrap();
let mut t = pt.clone();
let mut t = pt;
let t = &mut t[..i];
enc.encrypt(t);
assert_eq!(t, &ct[..i]);
Expand Down

0 comments on commit 7bfb327

Please sign in to comment.