diff options
author | Jimmy Miller <jimmy.miller@shopify.com> | 2022-10-14 13:04:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 13:04:53 -0400 |
commit | fb99227ca1ee9d8540d251c8b61c3e6433211714 (patch) | |
tree | aaf5cd7a3e1dde54ba0b4986e15961f317e50167 /yjit/src/asm | |
parent | 7e81dd94073d699f6f0c930072cd43e5e387784e (diff) | |
download | ruby-fb99227ca1ee9d8540d251c8b61c3e6433211714.tar.gz |
More clippy fixes (#6547)
Diffstat (limited to 'yjit/src/asm')
-rw-r--r-- | yjit/src/asm/arm64/arg/shifted_imm.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/yjit/src/asm/arm64/arg/shifted_imm.rs b/yjit/src/asm/arm64/arg/shifted_imm.rs index 0dd7af25b5..4602ac64ab 100644 --- a/yjit/src/asm/arm64/arg/shifted_imm.rs +++ b/yjit/src/asm/arm64/arg/shifted_imm.rs @@ -46,18 +46,24 @@ mod tests { #[test] fn test_no_shift() { - let value = 256; - let result = ShiftedImmediate::try_from(value); + let expected_value = 256; + let result = ShiftedImmediate::try_from(expected_value); - assert!(matches!(result, Ok(ShiftedImmediate { shift: Shift::LSL0, value }))); + match result { + Ok(ShiftedImmediate { shift: Shift::LSL0, value }) => assert_eq!(value as u64, expected_value), + _ => panic!("Unexpected shift value") + } } #[test] fn test_maximum_no_shift() { - let value = (1 << 12) - 1; - let result = ShiftedImmediate::try_from(value); + let expected_value = (1 << 12) - 1; + let result = ShiftedImmediate::try_from(expected_value); - assert!(matches!(result, Ok(ShiftedImmediate { shift: Shift::LSL0, value }))); + match result { + Ok(ShiftedImmediate { shift: Shift::LSL0, value }) => assert_eq!(value as u64, expected_value), + _ => panic!("Unexpected shift value") + } } #[test] |