File tree Expand file tree Collapse file tree 3 files changed +9
-21
lines changed Expand file tree Collapse file tree 3 files changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,10 @@ fn get_args(name: &str) -> Option<FluentArgs> {
58
58
}
59
59
60
60
fn add_functions < R > ( name : & ' static str , bundle : & mut FluentBundle < R > ) {
61
- match name {
62
- "preferences" => {
63
- bundle
64
- . add_function ( "PLATFORM" , |_args, _named_args| "linux" . into ( ) )
65
- . expect ( "Failed to add a function to the bundle." ) ;
66
- }
67
- _ => { }
61
+ if name == "preferences" {
62
+ bundle
63
+ . add_function ( "PLATFORM" , |_args, _named_args| "linux" . into ( ) )
64
+ . expect ( "Failed to add a function to the bundle." ) ;
68
65
}
69
66
}
70
67
Original file line number Diff line number Diff line change @@ -5,13 +5,10 @@ use unic_langid::{langid, LanguageIdentifier};
5
5
const LANG_EN : LanguageIdentifier = langid ! ( "en" ) ;
6
6
7
7
fn add_functions < R > ( name : & ' static str , bundle : & mut FluentBundle < R > ) {
8
- match name {
9
- "preferences" => {
10
- bundle
11
- . add_function ( "PLATFORM" , |_args, _named_args| "linux" . into ( ) )
12
- . expect ( "Failed to add a function to the bundle." ) ;
13
- }
14
- _ => { }
8
+ if name == "preferences" {
9
+ bundle
10
+ . add_function ( "PLATFORM" , |_args, _named_args| "linux" . into ( ) )
11
+ . expect ( "Failed to add a function to the bundle." ) ;
15
12
}
16
13
}
17
14
Original file line number Diff line number Diff line change @@ -55,14 +55,8 @@ fn borrowed_plain_message() {
55
55
bundle. format_pattern ( value, None , & mut errors)
56
56
} ;
57
57
58
- fn is_borrowed ( cow : Cow < ' _ , str > ) -> bool {
59
- match cow {
60
- Cow :: Borrowed ( _) => true ,
61
- _ => false ,
62
- }
63
- }
64
58
assert_eq ! ( formatted_pattern, "Value" ) ;
65
- assert ! ( is_borrowed ( formatted_pattern) ) ;
59
+ assert ! ( matches! ( formatted_pattern, Cow :: Borrowed ( _ ) ) ) ;
66
60
}
67
61
68
62
#[ test]
You can’t perform that action at this time.
0 commit comments