File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,22 @@ pub trait Source: Debug {
17
17
fn collect_to ( & self , cache : & mut Value ) -> Result < ( ) > {
18
18
self . collect ( ) ?
19
19
. iter ( )
20
- . for_each ( |( key, val) | match path:: Expression :: from_str ( key) {
21
- // Set using the path
22
- Ok ( expr) => expr. set ( cache, val. clone ( ) ) ,
23
-
24
- // Set diretly anyway
25
- _ => path:: Expression :: Identifier ( key. clone ( ) ) . set ( cache, val. clone ( ) ) ,
26
- } ) ;
20
+ . for_each ( |( key, val) | set_value ( cache, key, val) ) ;
27
21
28
22
Ok ( ( ) )
29
23
}
30
24
}
31
25
26
+ fn set_value ( cache : & mut Value , key : & String , value : & Value ) {
27
+ match path:: Expression :: from_str ( key) {
28
+ // Set using the path
29
+ Ok ( expr) => expr. set ( cache, value. clone ( ) ) ,
30
+
31
+ // Set diretly anyway
32
+ _ => path:: Expression :: Identifier ( key. clone ( ) ) . set ( cache, value. clone ( ) ) ,
33
+ }
34
+ }
35
+
32
36
impl Clone for Box < dyn Source + Send + Sync > {
33
37
fn clone ( & self ) -> Box < dyn Source + Send + Sync > {
34
38
self . clone_into_box ( )
You can’t perform that action at this time.
0 commit comments