diff options
author | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-03-30 12:39:46 +0100 |
---|---|---|
committer | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2017-04-12 09:24:16 +0100 |
commit | 635e742488c076fb646efb86e182ffa9ff8fe73d (patch) | |
tree | 770c7862b1070f458016167975c8c2d50b9d9eea /src | |
parent | e3976358fd767248015c4bc7d4edecd4db4df7ac (diff) | |
download | milf-rs-635e742488c076fb646efb86e182ffa9ff8fe73d.tar.gz milf-rs-635e742488c076fb646efb86e182ffa9ff8fe73d.zip |
Switch from comparison to is_empty()
Diffstat (limited to 'src')
-rw-r--r-- | src/de.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 { |