aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-03-30 12:40:27 +0100
committerDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-04-12 09:28:56 +0100
commita2053c850515a0d9f45cd0a3cec9acc555117e87 (patch)
treebf61e65c9ca2eaaeb50da47f4726881f38422401 /tests
parent635e742488c076fb646efb86e182ffa9ff8fe73d (diff)
downloadmilf-rs-a2053c850515a0d9f45cd0a3cec9acc555117e87.tar.gz
milf-rs-a2053c850515a0d9f45cd0a3cec9acc555117e87.zip
Simplify if-statements
Diffstat (limited to 'tests')
-rw-r--r--tests/valid.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/valid.rs b/tests/valid.rs
index 4229f1c..e8ea6af 100644
--- a/tests/valid.rs
+++ b/tests/valid.rs
@@ -18,7 +18,7 @@ fn to_json(toml: toml::Value) -> Json {
Toml::Float(f) => doit("float", Json::String({
let s = format!("{:.15}", f);
let s = format!("{}", s.trim_right_matches('0'));
- if s.ends_with(".") {format!("{}0", s)} else {s}
+ if s.ends_with('.') {format!("{}0", s)} else {s}
})),
Toml::Boolean(b) => doit("bool", Json::String(format!("{}", b))),
Toml::Datetime(s) => doit("datetime", Json::String(s.to_string())),