Merge pull request #103 from MarkSwanson/lookup-lifetime-enhancement

lookup() and lookup_mut() lifetime enhancements.
This commit is contained in:
Alex Crichton 2016-06-01 12:36:30 -07:00
commit 7363dbe7f5

View file

@ -180,7 +180,7 @@ impl Value {
/// let no_bar = value.lookup("test.bar"); /// let no_bar = value.lookup("test.bar");
/// assert_eq!(no_bar.is_none(), true); /// 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() { let ref path = match Parser::new(path).lookup() {
Some(path) => path, Some(path) => path,
None => return None, None => return None,