File tree 3 files changed +45
-3
lines changed 3 files changed +45
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Workspace
2
+
3
+ on :
4
+ pull_request :
5
+ paths-ignore :
6
+ - README.md
7
+ push :
8
+ branches : master
9
+ paths-ignore :
10
+ - README.md
11
+
12
+ jobs :
13
+ clippy :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v1
17
+ - uses : actions-rs/toolchain@v1
18
+ with :
19
+ profile : minimal
20
+ toolchain : 1.41.0 # MSRV
21
+ components : clippy
22
+ - run : cargo clippy --all -- -D warnings
23
+
24
+ rustfmt :
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - name : Checkout sources
28
+ uses : actions/checkout@v1
29
+
30
+ - name : Install stable toolchain
31
+ uses : actions-rs/toolchain@v1
32
+ with :
33
+ profile : minimal
34
+ toolchain : stable
35
+ components : rustfmt
36
+
37
+ - name : Run cargo fmt
38
+ uses : actions-rs/cargo@v1
39
+ with :
40
+ command : fmt
41
+ args : --all -- --check
Original file line number Diff line number Diff line change 20
20
#![ doc( html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png" ) ]
21
21
#![ forbid( unsafe_code) ]
22
22
#![ warn( missing_docs, rust_2018_idioms) ]
23
+ #![ allow( clippy:: needless_range_loop) ]
23
24
24
25
pub use crypto_mac:: { self , Mac , NewMac } ;
25
26
@@ -88,7 +89,7 @@ impl Mac for Daa {
88
89
}
89
90
}
90
91
91
- if data. len ( ) != 0 {
92
+ if ! data. is_empty ( ) {
92
93
self . cipher . encrypt_block ( & mut self . buffer ) ;
93
94
for ( a, b) in self . buffer . iter_mut ( ) . zip ( data) {
94
95
* a ^= * b;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ where
103
103
l_cache[ i] = l_cache[ i - 1 ] . clone ( ) . dbl ( ) ;
104
104
}
105
105
106
- let l_inv = l0. clone ( ) . inv_dbl ( ) ;
106
+ let l_inv = l0. inv_dbl ( ) ;
107
107
108
108
Self {
109
109
cipher,
@@ -222,7 +222,7 @@ where
222
222
223
223
self . pos = n;
224
224
225
- if data. len ( ) != 0 {
225
+ if ! data. is_empty ( ) {
226
226
self . process_buffer ( ) ;
227
227
self . as_mut_bytes ( ) [ ..data. len ( ) ] . clone_from_slice ( data) ;
228
228
self . pos = data. len ( ) ;
You can’t perform that action at this time.
0 commit comments