Remove Parser's lifetime

This commit is contained in:
freestrings
2019-06-03 18:45:26 +09:00
parent 498f2ce4f4
commit ac3224892b
7 changed files with 198 additions and 209 deletions

View File

@ -508,8 +508,7 @@ impl<'a> Selector<'a> {
pub fn path(&mut self, path: &str) -> Result<&mut Self, JsonPathError> {
debug!("path : {}", path);
let mut parser = Parser::new(path);
self.node = Some(parser.compile().map_err(|e| JsonPathError::Path(e))?);
self.node = Some(Parser::compile(path).map_err(|e| JsonPathError::Path(e))?);
Ok(self)
}