Skip to content
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

Fix lints introduced by clippy 1.78 to 1.80 #188

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 9 additions & 9 deletions genapi/src/masked_int_reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl BitMask {
match sign {
Sign::Signed => {
if msb - lsb == 63 {
std::i64::MIN
i64::MIN
} else {
let value = 1 << (msb - lsb) as i64;
-value
Expand All @@ -394,13 +394,13 @@ impl BitMask {
self.msb(reg_byte_len, endianness),
);
if msb - lsb == 63 {
return std::i64::MAX;
return i64::MAX;
}
match sign {
Sign::Signed => (1 << (msb - lsb)) - 1,
Sign::Unsigned => {
if msb - lsb == 63 {
std::i64::MAX
i64::MAX
} else {
(1 << (msb - lsb + 1)) - 1
}
Expand Down Expand Up @@ -517,7 +517,7 @@ mod tests {

let sign = Sign::Unsigned;
assert_eq!(mask.min(reg_len, endianness, sign), 0);
assert_eq!(mask.max(reg_len, endianness, sign), std::i64::MAX);
assert_eq!(mask.max(reg_len, endianness, sign), i64::MAX);
let value = mask.apply_mask(reg_value, reg_len, endianness, sign);
assert_eq!(value, i64::MAX);
let new_value = mask
Expand All @@ -526,13 +526,13 @@ mod tests {
assert_eq!(new_value, 0);

let sign = Sign::Signed;
assert_eq!(mask.min(reg_len, endianness, sign), std::i64::MIN);
assert_eq!(mask.max(reg_len, endianness, sign), std::i64::MAX);
assert_eq!(mask.min(reg_len, endianness, sign), i64::MIN);
assert_eq!(mask.max(reg_len, endianness, sign), i64::MAX);
let value = mask.apply_mask(reg_value, reg_len, endianness, sign);
assert_eq!(value, std::i64::MAX);
assert_eq!(value, i64::MAX);
let new_value = mask
.masked_value(reg_value, std::i64::MIN, reg_len, endianness, sign)
.masked_value(reg_value, i64::MIN, reg_len, endianness, sign)
.unwrap();
assert_eq!(new_value, std::i64::MIN);
assert_eq!(new_value, i64::MIN);
}
}
2 changes: 1 addition & 1 deletion genapi/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ impl CacheStore for DefaultCacheStore {
.and_modify(|level1| {
level1
.entry((address, length))
.and_modify(|level2| *level2 = data.to_owned())
.and_modify(|level2| data.clone_into(level2))
.or_insert_with(|| data.to_owned());
})
.or_insert_with(|| {
Expand Down
Loading