@@ -50,13 +50,13 @@ impl ResourceManager {
50
50
/// memory, or retrieving it from an in-memory cache.
51
51
fn get_resource (
52
52
& self ,
53
- res_id : & str ,
53
+ resource_id : & str ,
54
54
locale : & str ,
55
55
) -> Result < & FluentResource , ResourceManagerError > {
56
56
let path = self
57
57
. path_scheme
58
58
. replace ( "{locale}" , locale)
59
- . replace ( "{res_id}" , res_id ) ;
59
+ . replace ( "{res_id}" , resource_id ) ;
60
60
Ok ( if let Some ( resource) = self . resources . get ( & path) {
61
61
resource
62
62
} else {
@@ -86,18 +86,19 @@ impl ResourceManager {
86
86
match self . get_resource ( resource_id, & locale. to_string ( ) ) {
87
87
Ok ( resource) => {
88
88
if let Err ( errs) = bundle. add_resource ( resource) {
89
- errs. into_iter ( )
90
- . for_each ( |error| errors. push ( ResourceManagerError :: Fluent ( error) ) )
89
+ for error in errs {
90
+ errors. push ( ResourceManagerError :: Fluent ( error) ) ;
91
+ }
91
92
}
92
93
}
93
94
Err ( error) => errors. push ( error) ,
94
95
} ;
95
96
}
96
97
97
- if !errors. is_empty ( ) {
98
- Err ( errors)
99
- } else {
98
+ if errors. is_empty ( ) {
100
99
Ok ( bundle)
100
+ } else {
101
+ Err ( errors)
101
102
}
102
103
}
103
104
@@ -123,9 +124,9 @@ impl ResourceManager {
123
124
match self . get_resource ( resource_id, & locale. to_string ( ) ) {
124
125
Ok ( resource) => {
125
126
if let Err ( errs) = bundle. add_resource ( resource) {
126
- errs . into_iter ( ) . for_each ( | error| {
127
+ for error in errs {
127
128
errors. push ( ResourceManagerError :: Fluent ( error) )
128
- } )
129
+ }
129
130
}
130
131
}
131
132
Err ( error) => errors. push ( error) ,
0 commit comments