aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-01-20 23:30:45 -0500
committerCorey Farwell <coreyf@rwell.org>2016-01-21 08:38:09 -0500
commit7be39d725d6d251366d1cbd2566651b011cdb5a3 (patch)
tree5233aac487e0871823267670b58310a3ab24e8bf /src/lib.rs
parent6fe6a15fe526b08010ff3e6acaf52d3665d34d6b (diff)
downloadmilf-rs-7be39d725d6d251366d1cbd2566651b011cdb5a3.tar.gz
milf-rs-7be39d725d6d251366d1cbd2566651b011cdb5a3.zip
Address issues found by rust-clippy
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b0c8e4b..a5ecb5d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,7 +108,7 @@ impl Value {
}
/// Extracts the string of this value if it is a string.
- pub fn as_str<'a>(&'a self) -> Option<&'a str> {
+ pub fn as_str(&self) -> Option<&str> {
match *self { Value::String(ref s) => Some(&**s), _ => None }
}
@@ -135,17 +135,17 @@ impl Value {
/// ```notrust
/// 1979-05-27T07:32:00Z
/// ```
- pub fn as_datetime<'a>(&'a self) -> Option<&'a str> {
+ pub fn as_datetime(&self) -> Option<&str> {
match *self { Value::Datetime(ref s) => Some(&**s), _ => None }
}
/// Extracts the array value if it is an array.
- pub fn as_slice<'a>(&'a self) -> Option<&'a [Value]> {
+ pub fn as_slice(&self) -> Option<&[Value]> {
match *self { Value::Array(ref s) => Some(&**s), _ => None }
}
/// Extracts the table value if it is a table.
- pub fn as_table<'a>(&'a self) -> Option<&'a Table> {
+ pub fn as_table(&self) -> Option<&Table> {
match *self { Value::Table(ref s) => Some(s), _ => None }
}
@@ -187,14 +187,14 @@ impl Value {
}
for key in path.split('.') {
- match cur_value {
- &Value::Table(ref hm) => {
+ match *cur_value {
+ Value::Table(ref hm) => {
match hm.get(key) {
Some(v) => cur_value = v,
None => return None
}
},
- &Value::Array(ref v) => {
+ Value::Array(ref v) => {
match key.parse::<usize>().ok() {
Some(idx) if idx < v.len() => cur_value = &v[idx],
_ => return None