A few more minor lints, keyword fix

keywords must not have any special chars
pull/773/head
Yuri Astrakhan 11 months ago committed by Thomas Tanon
parent 9e3758e2c9
commit 089875ad21
  1. 2
      cli/src/main.rs
  2. 2
      fuzz/fuzz_targets/sparql_eval.rs
  3. 4
      fuzz/src/result_format.rs
  4. 2
      js/Cargo.toml
  5. 7
      lib/oxigraph/src/sparql/error.rs
  6. 32
      lib/oxrdfxml/src/parser.rs
  7. 6
      lib/sparesults/src/serializer.rs
  8. 2
      lib/spargebra/src/algebra.rs
  9. 8
      lib/sparql-smith/src/lib.rs
  10. 2
      testsuite/src/manifest.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(())
}

@ -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::<Vec<_>>();
b.sort_unstable();
b.join(" ")

@ -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::<Result<Vec<_>, _>>()
.with_context(|| format!("Parsing {:?}", &serialized))
.with_context(|| format!("Parsing {serialized:?}"))
.unwrap(),
solutions
)

@ -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

@ -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"),
}
}

@ -600,11 +600,9 @@ impl<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
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<R> RdfXmlReader<R> {
|| *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 {

@ -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(())
/// # }
/// ```

@ -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} }}")
}

@ -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(())
}

@ -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}")?;

Loading…
Cancel
Save