diff options
author | leonardo.yvens <leoyvens@gmail.com> | 2016-06-03 23:14:42 -0300 |
---|---|---|
committer | leonardo.yvens <leoyvens@gmail.com> | 2016-06-03 23:19:15 -0300 |
commit | e8097b14f1ea246bf97af380670c502ba1517f30 (patch) | |
tree | 40af4185d533d301627959030c2c380771f8f460 /src/lib.rs | |
parent | 44fc9d9f37cd1b2e3d9170d04fd0a8a04d7884ff (diff) | |
download | milf-rs-e8097b14f1ea246bf97af380670c502ba1517f30.tar.gz milf-rs-e8097b14f1ea246bf97af380670c502ba1517f30.zip |
Clippy run
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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<Value>; -/// 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<String, Value>; 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) } |