aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Gubler <erichdongubler@gmail.com>2019-04-02 09:35:28 -0600
committerErich Gubler <erichdongubler@gmail.com>2019-04-02 09:35:28 -0600
commitd1552ef0eeff95b1d5ce60787ae6cc6c63832615 (patch)
treeec612df2c878836a3d18d7399607abccfb01abb1
parentd729bf9c53fcfe8f1e5506a938b88d81526b55a4 (diff)
downloadmilf-rs-d1552ef0eeff95b1d5ce60787ae6cc6c63832615.tar.gz
milf-rs-d1552ef0eeff95b1d5ce60787ae6cc6c63832615.zip
Fix warnings for deprecated usages of trim_{left,right}_matches.
-rw-r--r--src/datetime.rs2
-rw-r--r--src/de.rs4
-rw-r--r--test-suite/tests/valid.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/datetime.rs b/src/datetime.rs
index 9239593..b77621a 100644
--- a/src/datetime.rs
+++ b/src/datetime.rs
@@ -99,7 +99,7 @@ impl fmt::Display for Time {
write!(f, "{:02}:{:02}:{:02}", self.hour, self.minute, self.second)?;
if self.nanosecond != 0 {
let s = format!("{:09}", self.nanosecond);
- write!(f, ".{}", s.trim_right_matches('0'))?;
+ write!(f, ".{}", s.trim_end_matches('0'))?;
}
Ok(())
}
diff --git a/src/de.rs b/src/de.rs
index 92db5d0..6b7c43b 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -1321,7 +1321,7 @@ impl<'a> Deserializer<'a> {
if suffix != "" {
return Err(self.error(start, ErrorKind::NumberInvalid));
}
- i64::from_str_radix(&prefix.replace("_", "").trim_left_matches('+'), radix)
+ i64::from_str_radix(&prefix.replace("_", "").trim_start_matches('+'), radix)
.map_err(|_e| self.error(start, ErrorKind::NumberInvalid))
}
@@ -1399,7 +1399,7 @@ impl<'a> Deserializer<'a> {
}
let mut number = integral
- .trim_left_matches('+')
+ .trim_start_matches('+')
.chars()
.filter(|c| *c != '_')
.collect::<String>();
diff --git a/test-suite/tests/valid.rs b/test-suite/tests/valid.rs
index 7c1691c..68e0ea2 100644
--- a/test-suite/tests/valid.rs
+++ b/test-suite/tests/valid.rs
@@ -19,7 +19,7 @@ fn to_json(toml: toml::Value) -> Json {
Toml::Integer(i) => doit("integer", Json::String(i.to_string())),
Toml::Float(f) => doit("float", Json::String({
let s = format!("{:.15}", f);
- let s = format!("{}", s.trim_right_matches('0'));
+ let s = format!("{}", s.trim_end_matches('0'));
if s.ends_with('.') {format!("{}0", s)} else {s}
})),
Toml::Boolean(b) => doit("bool", Json::String(format!("{}", b))),