@@ -34,7 +34,10 @@ impl CountryRisk {
3434
3535 /// Check if enhanced due diligence is required
3636 pub fn requires_edd ( & self ) -> bool {
37- matches ! ( self . risk_level, CountryRiskLevel :: High | CountryRiskLevel :: Prohibited )
37+ matches ! (
38+ self . risk_level,
39+ CountryRiskLevel :: High | CountryRiskLevel :: Prohibited
40+ )
3841 }
3942}
4043
@@ -46,7 +49,7 @@ pub struct JurisdictionRisk {
4649 pub is_offshore : bool ,
4750 pub is_fatf_greylist : bool ,
4851 pub is_fatf_blacklist : bool ,
49- pub transparency_score : u8 , // 0-100
52+ pub transparency_score : u8 , // 0-100
5053 pub regulatory_strength : u8 , // 0-100
5154 pub overall_risk : CountryRiskLevel ,
5255}
@@ -117,10 +120,7 @@ impl GeographicRiskScorer {
117120 country_name : "North Korea" . to_string ( ) ,
118121 risk_level : CountryRiskLevel :: Prohibited ,
119122 risk_score : 100 ,
120- factors : vec ! [
121- "FATF Blacklist" . to_string( ) ,
122- "UN Sanctions" . to_string( ) ,
123- ] ,
123+ factors : vec ! [ "FATF Blacklist" . to_string( ) , "UN Sanctions" . to_string( ) ] ,
124124 fatf_status : Some ( "Blacklist" . to_string ( ) ) ,
125125 sanctions_programs : vec ! [ "OFAC North Korea" . to_string( ) , "UN Sanctions" . to_string( ) ] ,
126126 } ) ;
@@ -144,7 +144,10 @@ impl GeographicRiskScorer {
144144 country_name : "Myanmar" . to_string ( ) ,
145145 risk_level : CountryRiskLevel :: High ,
146146 risk_score : 80 ,
147- factors : vec ! [ "FATF Greylist" . to_string( ) , "Targeted Sanctions" . to_string( ) ] ,
147+ factors : vec ! [
148+ "FATF Greylist" . to_string( ) ,
149+ "Targeted Sanctions" . to_string( ) ,
150+ ] ,
148151 fatf_status : Some ( "Greylist" . to_string ( ) ) ,
149152 sanctions_programs : vec ! [ ] ,
150153 } ) ;
@@ -154,7 +157,10 @@ impl GeographicRiskScorer {
154157 country_name : "Yemen" . to_string ( ) ,
155158 risk_level : CountryRiskLevel :: High ,
156159 risk_score : 75 ,
157- factors : vec ! [ "Conflict Zone" . to_string( ) , "Targeted Sanctions" . to_string( ) ] ,
160+ factors : vec ! [
161+ "Conflict Zone" . to_string( ) ,
162+ "Targeted Sanctions" . to_string( ) ,
163+ ] ,
158164 fatf_status : None ,
159165 sanctions_programs : vec ! [ ] ,
160166 } ) ;
@@ -243,7 +249,8 @@ impl GeographicRiskScorer {
243249
244250 /// Add a jurisdiction risk entry
245251 pub fn add_jurisdiction_risk ( & mut self , risk : JurisdictionRisk ) {
246- self . jurisdiction_risks . insert ( risk. jurisdiction . clone ( ) , risk) ;
252+ self . jurisdiction_risks
253+ . insert ( risk. jurisdiction . clone ( ) , risk) ;
247254 }
248255
249256 /// Get country risk by ISO code
@@ -257,7 +264,11 @@ impl GeographicRiskScorer {
257264 }
258265
259266 /// Calculate transaction risk based on origin and destination countries
260- pub fn calculate_transaction_risk ( & self , origin : & str , destination : & str ) -> TransactionGeographicRisk {
267+ pub fn calculate_transaction_risk (
268+ & self ,
269+ origin : & str ,
270+ destination : & str ,
271+ ) -> TransactionGeographicRisk {
261272 let origin_risk = self . get_country_risk ( origin) ;
262273 let dest_risk = self . get_country_risk ( destination) ;
263274
@@ -267,11 +278,11 @@ impl GeographicRiskScorer {
267278 // Use the higher of the two risks, weighted
268279 let combined_score = ( ( origin_score as u16 * 40 + dest_score as u16 * 60 ) / 100 ) as u8 ;
269280
270- let is_prohibited = origin_risk. map_or ( false , |r| r. is_prohibited ( ) )
271- || dest_risk. map_or ( false , |r| r. is_prohibited ( ) ) ;
281+ let is_prohibited = origin_risk. is_some_and ( |r| r. is_prohibited ( ) )
282+ || dest_risk. is_some_and ( |r| r. is_prohibited ( ) ) ;
272283
273- let requires_edd = origin_risk. map_or ( false , |r| r. requires_edd ( ) )
274- || dest_risk. map_or ( false , |r| r. requires_edd ( ) ) ;
284+ let requires_edd = origin_risk. is_some_and ( |r| r. requires_edd ( ) )
285+ || dest_risk. is_some_and ( |r| r. requires_edd ( ) ) ;
275286
276287 let risk_level = if is_prohibited {
277288 CountryRiskLevel :: Prohibited
0 commit comments