From e8097b14f1ea246bf97af380670c502ba1517f30 Mon Sep 17 00:00:00 2001 From: "leonardo.yvens" Date: Fri, 3 Jun 2016 23:14:42 -0300 Subject: Clippy run --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 21b3e21..a8e7dbb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,10 +72,10 @@ pub enum Value { Table(Table), } -/// Type representing a TOML array, payload of the Value::Array variant +/// Type representing a TOML array, payload of the `Value::Array` variant pub type Array = Vec; -/// Type representing a TOML table, payload of the Value::Table variant +/// Type representing a TOML table, payload of the `Value::Table` variant pub type Table = BTreeMap; impl Value { @@ -180,13 +180,13 @@ impl Value { /// let no_bar = value.lookup("test.bar"); /// assert_eq!(no_bar.is_none(), true); /// ``` - pub fn lookup<'a>(&'a self, path: &'a str) -> Option<&'a Value> { + pub fn lookup(&self, path: &str) -> Option<&Value> { let ref path = match Parser::new(path).lookup() { Some(path) => path, None => return None, }; let mut cur_value = self; - if path.len() == 0 { + if path.is_empty() { return Some(cur_value) } @@ -247,7 +247,7 @@ impl Value { }; let mut cur = self; - if path.len() == 0 { + if path.is_empty() { return Some(cur) } -- cgit v1.2.3