@@ -50,13 +50,13 @@ impl ResourceManager {
5050 /// memory, or retrieving it from an in-memory cache.
5151 fn get_resource (
5252 & self ,
53- res_id : & str ,
53+ resource_id : & str ,
5454 locale : & str ,
5555 ) -> Result < & FluentResource , ResourceManagerError > {
5656 let path = self
5757 . path_scheme
5858 . replace ( "{locale}" , locale)
59- . replace ( "{res_id}" , res_id ) ;
59+ . replace ( "{res_id}" , resource_id ) ;
6060 Ok ( if let Some ( resource) = self . resources . get ( & path) {
6161 resource
6262 } else {
@@ -86,18 +86,19 @@ impl ResourceManager {
8686 match self . get_resource ( resource_id, & locale. to_string ( ) ) {
8787 Ok ( resource) => {
8888 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+ }
9192 }
9293 }
9394 Err ( error) => errors. push ( error) ,
9495 } ;
9596 }
9697
97- if !errors. is_empty ( ) {
98- Err ( errors)
99- } else {
98+ if errors. is_empty ( ) {
10099 Ok ( bundle)
100+ } else {
101+ Err ( errors)
101102 }
102103 }
103104
@@ -123,9 +124,9 @@ impl ResourceManager {
123124 match self . get_resource ( resource_id, & locale. to_string ( ) ) {
124125 Ok ( resource) => {
125126 if let Err ( errs) = bundle. add_resource ( resource) {
126- errs . into_iter ( ) . for_each ( | error| {
127+ for error in errs {
127128 errors. push ( ResourceManagerError :: Fluent ( error) )
128- } )
129+ }
129130 }
130131 }
131132 Err ( error) => errors. push ( error) ,
0 commit comments