From 635e742488c076fb646efb86e182ffa9ff8fe73d Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 30 Mar 2017 12:39:46 +0100 Subject: Switch from comparison to is_empty() --- src/de.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3