A few more minor lints, keyword fix

keywords must not have any special chars
pull/773/head
Yuri Astrakhan 7 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()?; let server = server.spawn()?;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
systemd_notify_ready()?; systemd_notify_ready()?;
eprintln!("Listening for requests at http://{}", &bind); eprintln!("Listening for requests at http://{bind}");
server.join()?; server.join()?;
Ok(()) Ok(())
} }

@ -47,7 +47,7 @@ fn query_solutions_key(iter: QuerySolutionIter, is_reduced: bool) -> String {
let mut b = t let mut b = t
.unwrap() .unwrap()
.iter() .iter()
.map(|(var, val)| format!("{}: {}", var, val)) .map(|(var, val)| format!("{var}: {val}"))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
b.sort_unstable(); b.sort_unstable();
b.join(" ") b.join(" ")

@ -33,13 +33,13 @@ pub fn fuzz_result_format(format: QueryResultsFormat, data: &[u8]) {
// And to parse again // And to parse again
if let FromReadQueryResultsReader::Solutions(roundtrip_solutions) = parser if let FromReadQueryResultsReader::Solutions(roundtrip_solutions) = parser
.parse_read(serialized.as_bytes()) .parse_read(serialized.as_bytes())
.with_context(|| format!("Parsing {:?}", &serialized)) .with_context(|| format!("Parsing {serialized:?}"))
.unwrap() .unwrap()
{ {
assert_eq!( assert_eq!(
roundtrip_solutions roundtrip_solutions
.collect::<Result<Vec<_>, _>>() .collect::<Result<Vec<_>, _>>()
.with_context(|| format!("Parsing {:?}", &serialized)) .with_context(|| format!("Parsing {serialized:?}"))
.unwrap(), .unwrap(),
solutions solutions
) )

@ -4,7 +4,7 @@ version.workspace = true
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" 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" repository = "https://github.com/oxigraph/oxigraph/tree/main/js"
description = "JavaScript bindings of Oxigraph" description = "JavaScript bindings of Oxigraph"
edition.workspace = true edition.workspace = true

@ -60,10 +60,9 @@ impl fmt::Display for EvaluationError {
Self::UnsupportedContentType(content_type) => { Self::UnsupportedContentType(content_type) => {
write!(f, "The content media type {content_type} is not supported") write!(f, "The content media type {content_type} is not supported")
} }
Self::ServiceDoesNotReturnSolutions => write!( Self::ServiceDoesNotReturnSolutions => {
f, f.write_str("The service is not returning solutions but a boolean or a graph")
"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"), 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 { if *attribute_url == *RDF_ID {
let mut id = self.convert_attribute(&attribute)?; let mut id = self.convert_attribute(&attribute)?;
if !is_nc_name(&id) { if !is_nc_name(&id) {
return Err(SyntaxError::msg(format!( return Err(
"{} is not a valid rdf:ID value", SyntaxError::msg(format!("{id} is not a valid rdf:ID value")).into(),
&id );
))
.into());
} }
id.insert(0, '#'); id.insert(0, '#');
id_attr = Some(id); id_attr = Some(id);
@ -612,8 +610,7 @@ impl<R> RdfXmlReader<R> {
let bag_id = self.convert_attribute(&attribute)?; let bag_id = self.convert_attribute(&attribute)?;
if !is_nc_name(&bag_id) { if !is_nc_name(&bag_id) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"{} is not a valid rdf:bagID value", "{bag_id} is not a valid rdf:bagID value"
&bag_id
)) ))
.into()); .into());
} }
@ -621,8 +618,7 @@ impl<R> RdfXmlReader<R> {
let id = self.convert_attribute(&attribute)?; let id = self.convert_attribute(&attribute)?;
if !is_nc_name(&id) { if !is_nc_name(&id) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"{} is not a valid rdf:nodeID value", "{id} is not a valid rdf:nodeID value"
&id
)) ))
.into()); .into());
} }
@ -644,8 +640,7 @@ impl<R> RdfXmlReader<R> {
type_attr = Some(attribute); type_attr = Some(attribute);
} else if RESERVED_RDF_ATTRIBUTES.contains(&&*attribute_url) { } else if RESERVED_RDF_ATTRIBUTES.contains(&&*attribute_url) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"{} is not a valid attribute", "{attribute_url} is not a valid attribute"
&attribute_url
)) ))
.into()); .into());
} else { } else {
@ -663,8 +658,7 @@ impl<R> RdfXmlReader<R> {
let iri = self.resolve_iri(&base_iri, iri)?; let iri = self.resolve_iri(&base_iri, iri)?;
if self.known_rdf_id.contains(iri.as_str()) { if self.known_rdf_id.contains(iri.as_str()) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"{} has already been used as rdf:ID value", "{iri} has already been used as rdf:ID value"
&iri
)) ))
.into()); .into());
} }
@ -718,8 +712,7 @@ impl<R> RdfXmlReader<R> {
RdfXmlState::Rdf { base_iri, language } RdfXmlState::Rdf { base_iri, language }
} else if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) { } else if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"Invalid node element tag name: {}", "Invalid node element tag name: {tag_name}"
&tag_name
)) ))
.into()); .into());
} else { } else {
@ -739,8 +732,7 @@ impl<R> RdfXmlReader<R> {
RdfXmlNextProduction::NodeElt => { RdfXmlNextProduction::NodeElt => {
if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) { if RESERVED_RDF_ELEMENTS.contains(&&*tag_name) {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"Invalid property element tag name: {}", "Invalid property element tag name: {tag_name}"
&tag_name
)) ))
.into()); .into());
} }
@ -761,8 +753,7 @@ impl<R> RdfXmlReader<R> {
let Some(RdfXmlState::NodeElt { li_counter, .. }) = self.state.last_mut() let Some(RdfXmlState::NodeElt { li_counter, .. }) = self.state.last_mut()
else { else {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"Invalid property element tag name: {}", "Invalid property element tag name: {tag_name}"
&tag_name
)) ))
.into()); .into());
}; };
@ -774,8 +765,7 @@ impl<R> RdfXmlReader<R> {
|| *tag_name == *RDF_DESCRIPTION || *tag_name == *RDF_DESCRIPTION
{ {
return Err(SyntaxError::msg(format!( return Err(SyntaxError::msg(format!(
"Invalid property element tag name: {}", "Invalid property element tag name: {tag_name}"
&tag_name
)) ))
.into()); .into());
} else { } else {

@ -88,8 +88,10 @@ impl QueryResultsSerializer {
/// # async fn main() -> std::io::Result<()> { /// # async fn main() -> std::io::Result<()> {
/// let json_serializer = QueryResultsSerializer::from_format(QueryResultsFormat::Json); /// let json_serializer = QueryResultsSerializer::from_format(QueryResultsFormat::Json);
/// let mut buffer = Vec::new(); /// let mut buffer = Vec::new();
/// json_serializer.serialize_boolean_to_tokio_async_write(&mut buffer, false).await?; /// json_serializer
/// assert_eq!(buffer, br#"{"head":{},"boolean":false}"r); /// .serialize_boolean_to_tokio_async_write(&mut buffer, false)
/// .await?;
/// assert_eq!(buffer, br#"{"head":{},"boolean":false}"#);
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```

@ -640,7 +640,7 @@ impl fmt::Display for GraphPattern {
Self::Filter { expr, inner } => { Self::Filter { expr, inner } => {
write!(f, "{inner} FILTER({expr})") 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 } => { Self::Graph { name, inner } => {
write!(f, "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 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::BuiltInCall(c) => write!(f, "{c}"), Self::BuiltInCall(c) => write!(f, "{c}"),
// Self::FunctionCall(c) => write!(f, "{}", c), // Self::FunctionCall(c) => write!(f, "{c}"),
Self::Projection(e, v) => { Self::Projection(e, v) => {
if let Some(v) = v { if let Some(v) = v {
write!(f, "({e} AS {v})") write!(f, "({e} AS {v})")
@ -549,7 +549,7 @@ struct InlineData {
impl fmt::Display for InlineData { impl fmt::Display for InlineData {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 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 { match self {
Self::BrackettedExpression(e) => write!(f, "{e}"), Self::BrackettedExpression(e) => write!(f, "{e}"),
Self::BuiltInCall(c) => write!(f, "{c}"), 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 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.iri)?; write!(f, "{}", self.iri)?;
// if let Some(args) = &self.args { // if let Some(args) = &self.args {
// write!(f, "{}", args)?; // write!(f, "{args}")?;
// } // }
Ok(()) Ok(())
} }

@ -34,7 +34,7 @@ impl fmt::Display for Test {
write!(f, " on file \"{action}\"")?; write!(f, " on file \"{action}\"")?;
} }
if let Some(query) = &self.query { if let Some(query) = &self.query {
write!(f, " on query {}", &query)?; write!(f, " on query {query}")?;
} }
for data in &self.data { for data in &self.data {
write!(f, " with data {data}")?; write!(f, " with data {data}")?;

Loading…
Cancel
Save