aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-03-30 12:39:46 +0100
committerDaniel Lockyer <thisisdaniellockyer@gmail.com>2017-04-12 09:24:16 +0100
commit635e742488c076fb646efb86e182ffa9ff8fe73d (patch)
tree770c7862b1070f458016167975c8c2d50b9d9eea
parente3976358fd767248015c4bc7d4edecd4db4df7ac (diff)
downloadmilf-rs-635e742488c076fb646efb86e182ffa9ff8fe73d.tar.gz
milf-rs-635e742488c076fb646efb86e182ffa9ff8fe73d.zip
Switch from comparison to is_empty()
-rw-r--r--src/de.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/de.rs b/src/de.rs
index 9b6a779..0888186 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -148,7 +148,7 @@ impl<'a, 'b> de::Deserializer for &'b mut Deserializer<'a> {
while let Some(line) = self.line()? {
match line {
Line::Table { at, mut header, array } => {
- if cur_table.header.len() > 0 || cur_table.values.is_some() {
+ if !cur_table.header.is_empty() || cur_table.values.is_some() {
tables.push(cur_table);
}
cur_table = Table {
@@ -175,7 +175,7 @@ impl<'a, 'b> de::Deserializer for &'b mut Deserializer<'a> {
}
}
}
- if cur_table.header.len() > 0 || cur_table.values.is_some() {
+ if !cur_table.header.is_empty() || cur_table.values.is_some() {
tables.push(cur_table);
}
@@ -1095,7 +1095,7 @@ impl fmt::Display for Error {
ErrorKind::__Nonexhaustive => panic!(),
}
- if self.inner.key.len() > 0 {
+ if !self.inner.key.is_empty() {
write!(f, " for key `")?;
for (i, k) in self.inner.key.iter().enumerate() {
if i > 0 {