File tree 3 files changed +2
-11
lines changed
programs/example-native-token-transfers/src
3 files changed +2
-11
lines changed Original file line number Diff line number Diff line change 70
70
run : cargo check --workspace --tests --manifest-path solana/Cargo.toml
71
71
72
72
- name : Run `cargo clippy`
73
- run : cargo clippy --workspace --tests --manifest-path solana/Cargo.toml -- -Dclippy::cast_possible_truncation
73
+ run : cargo clippy --workspace --tests --manifest-path solana/Cargo.toml
74
74
75
75
- name : Cache solana tools
76
76
id : cache-solana
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ resolver = "2"
9
9
[workspace .lints .clippy ]
10
10
# The following rules should be enabled but conflict with other open PRs.
11
11
# TODO enable the commented rules below
12
- # cast_possible_truncation = "deny"
12
+ cast_possible_truncation = " deny"
13
13
# cast_lossless= "deny"
14
14
# as_conversions = "deny"
15
15
# arithmetic_side_effects = "deny"
Original file line number Diff line number Diff line change @@ -31,11 +31,8 @@ impl Bitmap {
31
31
BM :: < 128 > :: from_value ( self . map ) . get ( index as usize )
32
32
}
33
33
34
- #[ allow( clippy:: cast_possible_truncation) ]
35
34
pub fn count_enabled_votes ( & self , enabled : Bitmap ) -> u8 {
36
35
let bm = BM :: < 128 > :: from_value ( self . map ) & BM :: < 128 > :: from_value ( enabled. map ) ;
37
- // Conversion from usize to u8 is safe here. The Bitmap uses u128, so it's maximum length
38
- // (number of true bits) is 128.
39
36
bm. len ( ) as u8
40
37
}
41
38
}
@@ -67,10 +64,4 @@ mod tests {
67
64
enabled. set ( 18 , false ) ;
68
65
assert_eq ! ( bm. count_enabled_votes( enabled) , 1 ) ;
69
66
}
70
-
71
- #[ test]
72
- fn test_bitmap_len ( ) {
73
- let max_bitmap = Bitmap :: from_value ( u128:: MAX ) ;
74
- assert_eq ! ( 128 , max_bitmap. count_enabled_votes( max_bitmap) ) ;
75
- }
76
67
}
You can’t perform that action at this time.
0 commit comments