summaryrefslogtreecommitdiff
path: root/yjit/src/asm/arm64/arg
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2022-10-14 13:04:53 -0400
committerGitHub <noreply@github.com>2022-10-14 13:04:53 -0400
commitfb99227ca1ee9d8540d251c8b61c3e6433211714 (patch)
treeaaf5cd7a3e1dde54ba0b4986e15961f317e50167 /yjit/src/asm/arm64/arg
parent7e81dd94073d699f6f0c930072cd43e5e387784e (diff)
More clippy fixes (#6547)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit/src/asm/arm64/arg')
-rw-r--r--yjit/src/asm/arm64/arg/shifted_imm.rs18
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]