Skip to content

Fix all new clippy linter warnings #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/fake_sign/modified_md5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Context {
/// Consume data.
#[cfg(target_pointer_width = "64")]
pub fn consume<T: AsRef<[u8]>>(&mut self, data: T) {
for chunk in data.as_ref().chunks(core::u32::MAX as usize) {
for chunk in data.as_ref().chunks(u32::MAX as usize) {
consume(self, chunk);
}
}
Expand Down Expand Up @@ -113,17 +113,14 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
macro_rules! add(
($a:expr, $b:expr) => ($a.wrapping_add($b));
);
macro_rules! rotate(
($x:expr, $n:expr) => (($x << $n) | ($x >> (32 - $n)));
);
{
macro_rules! F(
($x:expr, $y:expr, $z:expr) => (($x & $y) | (!$x & $z));
);
macro_rules! T(
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
$a = rotate!($a, $s);
$a = $a.rotate_left($s);
$a = add!($a, $b);
});
);
Expand Down Expand Up @@ -155,7 +152,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
macro_rules! T(
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
$a = rotate!($a, $s);
$a = $a.rotate_left($s);
$a = add!($a, $b);
});
);
Expand Down Expand Up @@ -187,7 +184,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
macro_rules! T(
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
$a = rotate!($a, $s);
$a = $a.rotate_left($s);
$a = add!($a, $b);
});
);
Expand Down Expand Up @@ -219,7 +216,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) {
macro_rules! T(
($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({
$a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac);
$a = rotate!($a, $s);
$a = $a.rotate_left($s);
$a = add!($a, $b);
});
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(non_upper_case_globals)]
#![allow(
clippy::transmute_ptr_to_ptr, // Introduced by com-rs
clippy::too_many_arguments, // We're wrapping and API outside of our control
clippy::too_many_arguments, // We're wrapping an API outside of our control
clippy::uninlined_format_args, // Unfavourable format; implies unneeded MSRV bump
)]

Expand Down
1 change: 1 addition & 0 deletions src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ impl DxcIncludeHandlerWrapper {
library: &'_ DxcLibrary,
include_handler: &'_ mut dyn DxcIncludeHandler,
) -> LocalClassAllocation<DxcIncludeHandlerWrapper> {
#[allow(clippy::missing_transmute_annotations)]
LocalClassAllocation::new(Self::allocate(
std::mem::transmute(library),
RefCell::new(std::mem::transmute(include_handler)),
Expand Down