File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ panic = 'abort'
6767[profile .dev ]
6868panic = ' abort'
6969
70+ [lints .rust ]
71+ unsafe_code = " deny"
72+
7073[lints .clippy ]
7174wildcard_dependencies = " deny"
7275
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ pub struct PriceEntry {
8686
8787impl From < SolanaPriceAccount > for PriceEntry {
8888 fn from ( other : SolanaPriceAccount ) -> PriceEntry {
89+ #[ allow( unsafe_code, reason = "for tests only" ) ]
8990 unsafe {
9091 // NOTE: We know the size is 32 because It's a Solana account. This is for tests only.
9192 let comp_mem = std:: slice:: from_raw_parts ( other. comp . as_ptr ( ) , 32 ) ;
@@ -102,6 +103,7 @@ impl PriceEntry {
102103 /// Construct the right underlying GenericPriceAccount based on the account size.
103104 #[ instrument( skip( acc) ) ]
104105 pub fn load_from_account ( acc : & [ u8 ] ) -> Option < Self > {
106+ #[ allow( unsafe_code, reason = "optimization" ) ]
105107 unsafe {
106108 let size = match acc. len ( ) {
107109 n if n == std:: mem:: size_of :: < SolanaPriceAccount > ( ) => 32 ,
You can’t perform that action at this time.
0 commit comments