summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-01-11 21:18:37 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-01-11 21:20:58 +0100
commite139879c6951d6274f04905c5c69d37c45b9e5cb (patch)
tree2e2c9607e72ea3faca04db05984b4be3d8198c11
parentb599d9ee463f99f3c4e9bc744be20e2992859a27 (diff)
Remove unused keyword "mut"
-rw-r--r--src/delete.rs18
-rw-r--r--src/insert.rs2
-rw-r--r--src/resolver/mut_creating_resolver.rs2
-rw-r--r--src/set.rs2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/delete.rs b/src/delete.rs
index 4a97809..d09da85 100644
--- a/src/delete.rs
+++ b/src/delete.rs
@@ -141,7 +141,7 @@ impl TomlValueDeleteExt for Value {
}
}
} else {
- let mut val = try!(resolve(self, &tokens, true))
+ let val = try!(resolve(self, &tokens, true))
.unwrap(); // safe because of resolve() guarantees
let last_token = last_token.unwrap();
match val {
@@ -528,8 +528,8 @@ mod test {
array = [ 1 ]
"#).unwrap();
- let mut ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
- let res = ary.delete_with_seperator(&String::from("[0]"), '.');
+ let ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
+ let res = ary.delete_with_seperator(&String::from("[0]"), '.');
assert!(res.is_ok());
@@ -545,8 +545,8 @@ mod test {
array = [ 1 ]
"#).unwrap();
- let mut ary = toml.read_mut(&String::from("array.[0]")).unwrap().unwrap();
- let res = ary.delete_with_seperator(&String::from("nonexist"), '.');
+ let ary = toml.read_mut(&String::from("array.[0]")).unwrap().unwrap();
+ let res = ary.delete_with_seperator(&String::from("nonexist"), '.');
assert!(res.is_err());
@@ -562,8 +562,8 @@ mod test {
array = 1
"#).unwrap();
- let mut ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
- let res = ary.delete_with_seperator(&String::from("[0]"), '.');
+ let ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
+ let res = ary.delete_with_seperator(&String::from("[0]"), '.');
assert!(res.is_err());
@@ -649,8 +649,8 @@ mod test {
array = [ { t = 1 }, { t = 2 } ]
"#).unwrap();
- let mut ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
- let res = ary.delete_with_seperator(&String::from("[1]"), '.');
+ let ary = toml.read_mut(&String::from("array")).unwrap().unwrap();
+ let res = ary.delete_with_seperator(&String::from("[1]"), '.');
assert!(res.is_err());
diff --git a/src/insert.rs b/src/insert.rs
index b8d8d68..d4c3ba7 100644
--- a/src/insert.rs
+++ b/src/insert.rs
@@ -93,7 +93,7 @@ impl TomlValueInsertExt for Value {
use resolver::mut_creating_resolver::resolve;
let mut tokens = try!(tokenize_with_seperator(query, sep));
- let (mut val, last) = match tokens.pop_last() {
+ let (val, last) = match tokens.pop_last() {
None => (self, Box::new(tokens)),
Some(last) => (try!(resolve(self, &tokens)), last),
diff --git a/src/resolver/mut_creating_resolver.rs b/src/resolver/mut_creating_resolver.rs
index c5a9457..9b0f8d8 100644
--- a/src/resolver/mut_creating_resolver.rs
+++ b/src/resolver/mut_creating_resolver.rs
@@ -386,7 +386,7 @@ mod test {
let result = do_resolve!(toml => "fruit.blah.[1].physical");
assert!(result.is_ok());
- let mut result = result.unwrap();
+ let result = result.unwrap();
let tokens = tokenize_with_seperator(&String::from("color"), '.').unwrap();
let result = resolve(result, &tokens);
diff --git a/src/set.rs b/src/set.rs
index ee06baa..bac65ea 100644
--- a/src/set.rs
+++ b/src/set.rs
@@ -45,7 +45,7 @@ impl TomlValueSetExt for Value {
let mut tokens = try!(tokenize_with_seperator(query, sep));
let last = tokens.pop_last();
- let mut val = try!(resolve(self, &tokens, true))
+ let val = try!(resolve(self, &tokens, true))
.unwrap(); // safe because of resolve() guarantees
let last = last.unwrap_or_else(|| Box::new(tokens));