diff --git a/cli/src/main.rs b/cli/src/main.rs index cff5cf79..99a9015d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -923,7 +923,7 @@ fn serve(store: Store, bind: &str, read_only: bool, cors: bool) -> anyhow::Resul let server = server.spawn()?; #[cfg(target_os = "linux")] systemd_notify_ready()?; - eprintln!("Listening for requests at http://{}", &bind); + eprintln!("Listening for requests at http://{bind}"); server.join()?; Ok(()) } diff --git a/fuzz/fuzz_targets/sparql_eval.rs b/fuzz/fuzz_targets/sparql_eval.rs index 24c8a176..142f0be9 100644 --- a/fuzz/fuzz_targets/sparql_eval.rs +++ b/fuzz/fuzz_targets/sparql_eval.rs @@ -47,7 +47,7 @@ fn query_solutions_key(iter: QuerySolutionIter, is_reduced: bool) -> String { let mut b = t .unwrap() .iter() - .map(|(var, val)| format!("{}: {}", var, val)) + .map(|(var, val)| format!("{var}: {val}")) .collect::>(); b.sort_unstable(); b.join(" ") diff --git a/fuzz/src/result_format.rs b/fuzz/src/result_format.rs index 5c6b59ae..d6e15c54 100644 --- a/fuzz/src/result_format.rs +++ b/fuzz/src/result_format.rs @@ -33,13 +33,13 @@ pub fn fuzz_result_format(format: QueryResultsFormat, data: &[u8]) { // And to parse again if let FromReadQueryResultsReader::Solutions(roundtrip_solutions) = parser .parse_read(serialized.as_bytes()) - .with_context(|| format!("Parsing {:?}", &serialized)) + .with_context(|| format!("Parsing {serialized:?}")) .unwrap() { assert_eq!( roundtrip_solutions .collect::, _>>() - .with_context(|| format!("Parsing {:?}", &serialized)) + .with_context(|| format!("Parsing {serialized:?}")) .unwrap(), solutions ) diff --git a/js/Cargo.toml b/js/Cargo.toml index 0b5156b3..8e62e147 100644 --- a/js/Cargo.toml +++ b/js/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true authors.workspace = true license.workspace = true readme = "README.md" -keywords = ["RDF", "N-Triples", "Turtle", "RDF/XML", "SPARQL"] +keywords = ["RDF", "N-Triples", "Turtle", "XML", "SPARQL"] repository = "https://github.com/oxigraph/oxigraph/tree/main/js" description = "JavaScript bindings of Oxigraph" edition.workspace = true diff --git a/lib/oxigraph/src/sparql/error.rs b/lib/oxigraph/src/sparql/error.rs index a8627790..b3516d8e 100644 --- a/lib/oxigraph/src/sparql/error.rs +++ b/lib/oxigraph/src/sparql/error.rs @@ -60,10 +60,9 @@ impl fmt::Display for EvaluationError { Self::UnsupportedContentType(content_type) => { write!(f, "The content media type {content_type} is not supported") } - Self::ServiceDoesNotReturnSolutions => write!( - f, - "The service is not returning solutions but a boolean or a graph" - ), + Self::ServiceDoesNotReturnSolutions => { + f.write_str("The service is not returning solutions but a boolean or a graph") + } Self::NotAGraph => f.write_str("The query results are not a RDF graph"), } } diff --git a/lib/oxrdfxml/src/parser.rs b/lib/oxrdfxml/src/parser.rs index 70ca91aa..a4e35784 100644 --- a/lib/oxrdfxml/src/parser.rs +++ b/lib/oxrdfxml/src/parser.rs @@ -600,11 +600,9 @@ impl RdfXmlReader { if *attribute_url == *RDF_ID { let mut id = self.convert_attribute(&attribute)?; if !is_nc_name(&id) { - return Err(SyntaxError::msg(format!( - "{} is not a valid rdf:ID value", - &id - )) - .into()); + return Err( + SyntaxError::msg(format!("{id} is not a valid rdf:ID value")).into(), + ); } id.insert(0, '#'); id_attr = Some(id); @@ -612,8 +610,7 @@ impl RdfXmlReader { let bag_id = self.convert_attribute(&attribute)?; if !is_nc_name(&bag_id) { return Err(SyntaxError::msg(format!( - "{} is not a valid rdf:bagID value", - &bag_id + "{bag_id} is not a valid rdf:bagID value" )) .into()); } @@ -621,8 +618,7 @@ impl RdfXmlReader { let id = self.convert_attribute(&attribute)?; if !is_nc_name(&id) { return Err(SyntaxError::msg(format!( - "{} is not a valid rdf:nodeID value", - &id + "{id} is not a valid rdf:nodeID value" )) .into()); } @@ -644,8 +640,7 @@ impl RdfXmlReader { type_attr = Some(attribute); } else if RESERVED_RDF_ATTRIBUTES.contains(&&*attribute_url) { return Err(SyntaxError::msg(format!( - "{} is not a valid attribute", - &attribute_url + "{attribute_url} is not a valid attribute" )) .into()); } else { @@ -663,8 +658,7 @@ impl RdfXmlReader { let iri = self.resolve_iri(&base_iri, iri)?; if self.known_rdf_id.contains(iri.as_str()) { return Err(SyntaxError::msg(format!( - "{} has already been used as rdf:ID value", - &iri + "{iri} has already been used as rdf:ID value" )) .into()); } @@ -718,8 +712,7 @@ impl RdfXmlReader { RdfXmlState::Rdf { base_iri, language } } else if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) { return Err(SyntaxError::msg(format!( - "Invalid node element tag name: {}", - &tag_name + "Invalid node element tag name: {tag_name}" )) .into()); } else { @@ -739,8 +732,7 @@ impl RdfXmlReader { RdfXmlNextProduction::NodeElt => { if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) { return Err(SyntaxError::msg(format!( - "Invalid property element tag name: {}", - &tag_name + "Invalid property element tag name: {tag_name}" )) .into()); } @@ -761,8 +753,7 @@ impl RdfXmlReader { let Some(RdfXmlState::NodeElt { li_counter, .. }) = self.state.last_mut() else { return Err(SyntaxError::msg(format!( - "Invalid property element tag name: {}", - &tag_name + "Invalid property element tag name: {tag_name}" )) .into()); }; @@ -774,8 +765,7 @@ impl RdfXmlReader { || *tag_name == *RDF_DESCRIPTION { return Err(SyntaxError::msg(format!( - "Invalid property element tag name: {}", - &tag_name + "Invalid property element tag name: {tag_name}" )) .into()); } else { diff --git a/lib/sparesults/src/serializer.rs b/lib/sparesults/src/serializer.rs index 1d4a02b1..ecc730cd 100644 --- a/lib/sparesults/src/serializer.rs +++ b/lib/sparesults/src/serializer.rs @@ -88,8 +88,10 @@ impl QueryResultsSerializer { /// # async fn main() -> std::io::Result<()> { /// let json_serializer = QueryResultsSerializer::from_format(QueryResultsFormat::Json); /// let mut buffer = Vec::new(); - /// json_serializer.serialize_boolean_to_tokio_async_write(&mut buffer, false).await?; - /// assert_eq!(buffer, br#"{"head":{},"boolean":false}"r); + /// json_serializer + /// .serialize_boolean_to_tokio_async_write(&mut buffer, false) + /// .await?; + /// assert_eq!(buffer, br#"{"head":{},"boolean":false}"#); /// # Ok(()) /// # } /// ``` diff --git a/lib/spargebra/src/algebra.rs b/lib/spargebra/src/algebra.rs index 9b38b71f..a261b2dc 100644 --- a/lib/spargebra/src/algebra.rs +++ b/lib/spargebra/src/algebra.rs @@ -640,7 +640,7 @@ impl fmt::Display for GraphPattern { Self::Filter { expr, inner } => { write!(f, "{inner} FILTER({expr})") } - Self::Union { left, right } => write!(f, "{{ {left} }} UNION {{ {right} }}",), + Self::Union { left, right } => write!(f, "{{ {left} }} UNION {{ {right} }}"), Self::Graph { name, inner } => { write!(f, "GRAPH {name} {{ {inner} }}") } diff --git a/lib/sparql-smith/src/lib.rs b/lib/sparql-smith/src/lib.rs index 7266f67e..6b114d68 100644 --- a/lib/sparql-smith/src/lib.rs +++ b/lib/sparql-smith/src/lib.rs @@ -246,7 +246,7 @@ impl fmt::Display for GroupCondition { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::BuiltInCall(c) => write!(f, "{c}"), - // Self::FunctionCall(c) => write!(f, "{}", c), + // Self::FunctionCall(c) => write!(f, "{c}"), Self::Projection(e, v) => { if let Some(v) = v { write!(f, "({e} AS {v})") @@ -549,7 +549,7 @@ struct InlineData { impl fmt::Display for InlineData { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "VALUES {}", &self.inner) + write!(f, "VALUES {}", self.inner) } } @@ -705,7 +705,7 @@ impl fmt::Display for Constraint { match self { Self::BrackettedExpression(e) => write!(f, "{e}"), Self::BuiltInCall(c) => write!(f, "{c}"), - // Self::FunctionCall(c) => write!(f, "{}", c), + // Self::FunctionCall(c) => write!(f, "{c}"), } } } @@ -1592,7 +1592,7 @@ impl fmt::Display for IriOrFunction { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.iri)?; // if let Some(args) = &self.args { - // write!(f, "{}", args)?; + // write!(f, "{args}")?; // } Ok(()) } diff --git a/testsuite/src/manifest.rs b/testsuite/src/manifest.rs index 97ee0ea7..b911a630 100644 --- a/testsuite/src/manifest.rs +++ b/testsuite/src/manifest.rs @@ -34,7 +34,7 @@ impl fmt::Display for Test { write!(f, " on file \"{action}\"")?; } if let Some(query) = &self.query { - write!(f, " on query {}", &query)?; + write!(f, " on query {query}")?; } for data in &self.data { write!(f, " with data {data}")?;