diff --git a/lib/oxsdatatypes/src/date_time.rs b/lib/oxsdatatypes/src/date_time.rs index 1acb2197..04e4a388 100644 --- a/lib/oxsdatatypes/src/date_time.rs +++ b/lib/oxsdatatypes/src/date_time.rs @@ -2308,7 +2308,7 @@ fn timezone_frag(input: &str) -> Result<(TimezoneOffset, &str), ParseDateTimeErr Ok(( TimezoneOffset::new(sign * (hours * 60 + i16::from(minutes))) - .map_err(|e| ParseDateTimeError::InvalidTimezone(e))?, + .map_err(ParseDateTimeError::InvalidTimezone)?, input, )) } diff --git a/lib/spargebra/src/parser.rs b/lib/spargebra/src/parser.rs index ecd980a4..df97fc6b 100644 --- a/lib/spargebra/src/parser.rs +++ b/lib/spargebra/src/parser.rs @@ -17,13 +17,13 @@ use std::str::FromStr; /// Parses a SPARQL query with an optional base IRI to resolve relative IRIs in the query. pub fn parse_query(query: &str, base_iri: Option<&str>) -> Result { let mut state = ParserState::from_base_iri(base_iri)?; - parser::QueryUnit(query, &mut state).map_err(|e| ParseError::Parser(e)) + parser::QueryUnit(query, &mut state).map_err(ParseError::Parser) } /// Parses a SPARQL update with an optional base IRI to resolve relative IRIs in the query. pub fn parse_update(update: &str, base_iri: Option<&str>) -> Result { let mut state = ParserState::from_base_iri(base_iri)?; - let operations = parser::UpdateInit(update, &mut state).map_err(|e| ParseError::Parser(e))?; + let operations = parser::UpdateInit(update, &mut state).map_err(ParseError::Parser)?; Ok(Update { operations, base_iri: state.base_iri, @@ -667,7 +667,7 @@ impl ParserState { pub(crate) fn from_base_iri(base_iri: Option<&str>) -> Result { Ok(Self { base_iri: if let Some(base_iri) = base_iri { - Some(Iri::parse(base_iri.to_owned()).map_err(|e| ParseError::InvalidBaseIri(e))?) + Some(Iri::parse(base_iri.to_owned()).map_err(ParseError::InvalidBaseIri)?) } else { None },