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> {
5858}
5959
6060fn 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." ) ;
6865 }
6966}
7067
Original file line number Diff line number Diff line change @@ -5,13 +5,10 @@ use unic_langid::{langid, LanguageIdentifier};
55const LANG_EN : LanguageIdentifier = langid ! ( "en" ) ;
66
77fn 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." ) ;
1512 }
1613}
1714
Original file line number Diff line number Diff line change @@ -55,14 +55,8 @@ fn borrowed_plain_message() {
5555 bundle. format_pattern ( value, None , & mut errors)
5656 } ;
5757
58- fn is_borrowed ( cow : Cow < ' _ , str > ) -> bool {
59- match cow {
60- Cow :: Borrowed ( _) => true ,
61- _ => false ,
62- }
63- }
6458 assert_eq ! ( formatted_pattern, "Value" ) ;
65- assert ! ( is_borrowed ( formatted_pattern) ) ;
59+ assert ! ( matches! ( formatted_pattern, Cow :: Borrowed ( _ ) ) ) ;
6660}
6761
6862#[ test]
You can’t perform that action at this time.
0 commit comments