diff --git a/src/jsonpath.rs b/src/jsonpath.rs index 19a2dac..e65c958 100644 --- a/src/jsonpath.rs +++ b/src/jsonpath.rs @@ -18,6 +18,6 @@ impl std::fmt::Display for SyntaxError { } } -pub fn parse<'a>(selector: &'a str) -> Result, SyntaxError> { +pub fn parse(selector: &str) -> Result, SyntaxError> { parser::parse(selector).map_err(|m| SyntaxError { message: m }) } diff --git a/src/matchers.rs b/src/matchers.rs index 1bbc488..288df1e 100644 --- a/src/matchers.rs +++ b/src/matchers.rs @@ -23,7 +23,7 @@ pub trait Matcher { pub struct RootSelector {} impl Matcher for RootSelector { - fn select<'a>(&'a self, node: &'a Value) -> Iter<'a> { + fn select<'a>(&self, node: &'a Value) -> Iter<'a> { Box::new(iter::once(node)) } } @@ -53,7 +53,7 @@ impl Child { } impl Matcher for Child { - fn select<'a>(&'a self, node: &'a Value) -> Iter<'a> { + fn select<'a>(&self, node: &'a Value) -> Iter<'a> { Box::new(node.get(&self.name).into_iter()) } } diff --git a/src/parser.rs b/src/parser.rs index 626a23c..7096728 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -12,7 +12,7 @@ use crate::pest::Parser; #[grammar = "grammar.pest"] struct PathParser; -pub fn parse<'a>(selector: &'a str) -> Result, String> { +pub fn parse(selector: &str) -> Result, String> { let selector_rule = PathParser::parse(Rule::selector, selector) .map_err(|e| format!("{}", e))? .next() diff --git a/src/path.rs b/src/path.rs index a02dd64..3c4d234 100644 --- a/src/path.rs +++ b/src/path.rs @@ -19,7 +19,7 @@ struct SelectorPath { matchers: Vec>, } -pub fn new<'a>(matchers: Vec>) -> impl Path + 'a { +pub fn new(matchers: Vec>) -> impl Path { SelectorPath { matchers } }