Skip to content

Commit

Permalink
Apply clippy recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Oct 31, 2024
1 parent b16e0ec commit 741aac4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions crates/e2e/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub struct SandboxErr {

impl SandboxErr {
/// Create a new `SandboxErr` with the given message.
#[allow(dead_code)]
pub fn new(msg: String) -> Self {
Self { msg }
}
Expand Down
36 changes: 18 additions & 18 deletions crates/env/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,52 +196,52 @@ mod tests {
#[test]
fn saturating_add() {
assert_eq!(
u64::max_value(),
Saturating::saturating_add(u64::max_value(), 1)
u64::MAX,
Saturating::saturating_add(u64::MAX, 1)
)
}

#[test]
fn saturatiung_sub() {
assert_eq!(
u64::min_value(),
Saturating::saturating_sub(u64::min_value(), 1)
u64::MIN,
Saturating::saturating_sub(u64::MIN, 1)
)
}

#[test]
fn saturating_mul() {
assert_eq!(
u64::max_value(),
Saturating::saturating_mul(u64::max_value(), 2)
u64::MAX,
Saturating::saturating_mul(u64::MAX, 2)
);
assert_eq!(
i64::max_value(),
Saturating::saturating_mul(i64::max_value(), 2)
i64::MAX,
Saturating::saturating_mul(i64::MAX, 2)
);
assert_eq!(
i64::min_value(),
Saturating::saturating_mul(i64::min_value(), 2)
i64::MIN,
Saturating::saturating_mul(i64::MIN, 2)
);
assert_eq!(
i64::min_value(),
Saturating::saturating_mul(2, i64::min_value())
i64::MIN,
Saturating::saturating_mul(2, i64::MIN)
);
}

#[test]
fn saturating_pow() {
assert_eq!(
u64::max_value(),
Saturating::saturating_pow(u64::max_value(), 2)
u64::MAX,
Saturating::saturating_pow(u64::MAX, 2)
);
assert_eq!(
i64::max_value(),
Saturating::saturating_pow(i64::min_value(), 2)
i64::MAX,
Saturating::saturating_pow(i64::MIN, 2)
);
assert_eq!(
i64::min_value(),
Saturating::saturating_pow(i64::min_value(), 3)
i64::MIN,
Saturating::saturating_pow(i64::MIN, 3)
);
}
}
1 change: 1 addition & 0 deletions crates/env/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ mod decode_instantiate_result_tests {
struct ContractError(String);

type AccountId = <DefaultEnvironment as Environment>::AccountId;
#[allow(dead_code)]
struct TestContractRef(AccountId);

impl crate::ContractEnv for TestContractRef {
Expand Down

0 comments on commit 741aac4

Please sign in to comment.