Skip to content

Commit 2a36f02

Browse files
committed
Fix all new clippy lints
1 parent 2518a89 commit 2a36f02

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/fake_sign/modified_md5.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Context {
6767
/// Consume data.
6868
#[cfg(target_pointer_width = "64")]
6969
pub fn consume<T: AsRef<[u8]>>(&mut self, data: T) {
70-
for chunk in data.as_ref().chunks(core::u32::MAX as usize) {
70+
for chunk in data.as_ref().chunks(u32::MAX as usize) {
7171
consume(self, chunk);
7272
}
7373
}
@@ -113,17 +113,14 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
113113
macro_rules! add(
114114
($a:expr, $b:expr) => ($a.wrapping_add($b));
115115
);
116-
macro_rules! rotate(
117-
($x:expr, $n:expr) => (($x << $n) | ($x >> (32 - $n)));
118-
);
119116
{
120117
macro_rules! F(
121118
($x:expr, $y:expr, $z:expr) => (($x & $y) | (!$x & $z));
122119
);
123120
macro_rules! T(
124121
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
125122
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
126-
$a = rotate!($a, $s);
123+
$a = $a.rotate_left($s);
127124
$a = add!($a, $b);
128125
});
129126
);
@@ -155,7 +152,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
155152
macro_rules! T(
156153
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
157154
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
158-
$a = rotate!($a, $s);
155+
$a = $a.rotate_left($s);
159156
$a = add!($a, $b);
160157
});
161158
);
@@ -187,7 +184,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
187184
macro_rules! T(
188185
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
189186
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
190-
$a = rotate!($a, $s);
187+
$a = $a.rotate_left($s);
191188
$a = add!($a, $b);
192189
});
193190
);
@@ -219,7 +216,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
219216
macro_rules! T(
220217
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
221218
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
222-
$a = rotate!($a, $s);
219+
$a = $a.rotate_left($s);
223220
$a = add!($a, $b);
224221
});
225222
);

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(non_upper_case_globals)]
33
#![allow(
44
clippy::transmute_ptr_to_ptr, // Introduced by com-rs
5-
clippy::too_many_arguments, // We're wrapping and API outside of our control
5+
clippy::too_many_arguments, // We're wrapping an API outside of our control
66
clippy::uninlined_format_args, // Unfavourable format; implies unneeded MSRV bump
77
)]
88

src/wrapper.rs

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ impl DxcIncludeHandlerWrapper {
210210
library: &'_ DxcLibrary,
211211
include_handler: &'_ mut dyn DxcIncludeHandler,
212212
) -> LocalClassAllocation<DxcIncludeHandlerWrapper> {
213+
#[allow(clippy::missing_transmute_annotations)]
213214
LocalClassAllocation::new(Self::allocate(
214215
std::mem::transmute(library),
215216
RefCell::new(std::mem::transmute(include_handler)),

0 commit comments

Comments
 (0)