@@ -8,33 +8,33 @@ pub(crate) fn parse(
8
8
text : & str ,
9
9
) -> Result < Map < String , Value > , Box < dyn Error + Send + Sync > > {
10
10
// Parse a TOML value from the provided text
11
- let table = from_toml_table ( uri, & toml:: from_str ( text) ?) ;
11
+ let table = from_toml_table ( uri, toml:: from_str ( text) ?) ;
12
12
Ok ( table)
13
13
}
14
14
15
- fn from_toml_table ( uri : Option < & String > , table : & toml:: Table ) -> Map < String , Value > {
15
+ fn from_toml_table ( uri : Option < & String > , table : toml:: Table ) -> Map < String , Value > {
16
16
let mut m = Map :: new ( ) ;
17
17
18
18
for ( key, value) in table {
19
- m. insert ( key. clone ( ) , from_toml_value ( uri, value) ) ;
19
+ m. insert ( key, from_toml_value ( uri, value) ) ;
20
20
}
21
21
22
22
m
23
23
}
24
24
25
- fn from_toml_value ( uri : Option < & String > , value : & toml:: Value ) -> Value {
26
- match * value {
27
- toml:: Value :: String ( ref value) => Value :: new ( uri, value. clone ( ) ) ,
25
+ fn from_toml_value ( uri : Option < & String > , value : toml:: Value ) -> Value {
26
+ match value {
27
+ toml:: Value :: String ( value) => Value :: new ( uri, value) ,
28
28
toml:: Value :: Float ( value) => Value :: new ( uri, value) ,
29
29
toml:: Value :: Integer ( value) => Value :: new ( uri, value) ,
30
30
toml:: Value :: Boolean ( value) => Value :: new ( uri, value) ,
31
31
32
- toml:: Value :: Table ( ref table) => {
32
+ toml:: Value :: Table ( table) => {
33
33
let m = from_toml_table ( uri, table) ;
34
34
Value :: new ( uri, m)
35
35
}
36
36
37
- toml:: Value :: Array ( ref array) => {
37
+ toml:: Value :: Array ( array) => {
38
38
let mut l = Vec :: new ( ) ;
39
39
40
40
for value in array {
@@ -44,6 +44,6 @@ fn from_toml_value(uri: Option<&String>, value: &toml::Value) -> Value {
44
44
Value :: new ( uri, l)
45
45
}
46
46
47
- toml:: Value :: Datetime ( ref datetime) => Value :: new ( uri, datetime. to_string ( ) ) ,
47
+ toml:: Value :: Datetime ( datetime) => Value :: new ( uri, datetime. to_string ( ) ) ,
48
48
}
49
49
}
0 commit comments