Skip to content

Commit f824bf5

Browse files
style: clippy + fmt
1 parent bdb223f commit f824bf5

File tree

5 files changed

+43
-11
lines changed

5 files changed

+43
-11
lines changed

rudof_cli/src/commands/shacl_validate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ impl Command for ShaclValidateCommand {
118118
};
119119

120120
// Perform SHACL validation
121-
let validation_report = ctx.rudof.validate_shacl(Some(&shacl_validation_mode), Some(&shapes_graph_source))?;
121+
let validation_report = ctx
122+
.rudof
123+
.validate_shacl(Some(&shacl_validation_mode), Some(&shapes_graph_source))?;
122124

123125
// Write the validation report to output
124126
self.write_validation_report(&mut ctx.writer, &result_format, validation_report, &sort_by)?;

rudof_cli/src/commands/shapemap.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ impl Command for ShapemapCommand {
3939
};
4040

4141
// Load shapemap into rudof
42-
ctx.rudof
43-
.read_shapemap(reader, self.args.shapemap.source_name().as_str(), &shapemap_format, &self.args.base)?;
42+
ctx.rudof.read_shapemap(
43+
reader,
44+
self.args.shapemap.source_name().as_str(),
45+
&shapemap_format,
46+
&self.args.base,
47+
)?;
4448

4549
// Write results in the requested format
4650
ctx.rudof

rudof_cli/src/commands/shex.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ impl ShexCommand {
5858
ctx: &mut CommandContext,
5959
format: &shex_ast::shex_format::ShExFormat,
6060
) -> Result<()> {
61-
if self.args.show_schema == true {
61+
if self.args.show_schema {
6262
let formatter = Self::get_formatter(&ctx.color);
63-
ctx.rudof.serialize_current_shex(Some(format), &formatter, &mut ctx.writer)?;
63+
ctx.rudof
64+
.serialize_current_shex(Some(format), &formatter, &mut ctx.writer)?;
6465
}
6566
Ok(())
6667
}

rudof_lib/src/rudof.rs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,24 @@ impl Rudof {
325325
source_name2: Option<&str>,
326326
) -> Result<ShaCo> {
327327
let reader_mode: ReaderMode = reader_mode.into();
328-
let coshamo1 = self.get_coshamo(reader1, &mode1, &format1, base1, Some(&reader_mode), label1, source_name1)?;
329-
let coshamo2 = self.get_coshamo(reader2, &mode2, &format2, base2, Some(&reader_mode), label2, source_name2)?;
328+
let coshamo1 = self.get_coshamo(
329+
reader1,
330+
&mode1,
331+
&format1,
332+
base1,
333+
Some(&reader_mode),
334+
label1,
335+
source_name1,
336+
)?;
337+
let coshamo2 = self.get_coshamo(
338+
reader2,
339+
&mode2,
340+
&format2,
341+
base2,
342+
Some(&reader_mode),
343+
label2,
344+
source_name2,
345+
)?;
330346
Ok(coshamo1.compare(&coshamo2))
331347
}
332348

@@ -1437,7 +1453,12 @@ impl Rudof {
14371453
/// * `input` - The input specification for the shapemap
14381454
/// * `shapemap_format` - The format of the shapemap
14391455
/// * `base` - Optional base IRI for resolving relative IRIs in the shapemap
1440-
pub fn load_shapemap(&mut self, input: &InputSpec, shapemap_format: &ShapeMapFormat, base: &Option<IriS>) -> Result<()> {
1456+
pub fn load_shapemap(
1457+
&mut self,
1458+
input: &InputSpec,
1459+
shapemap_format: &ShapeMapFormat,
1460+
base: &Option<IriS>,
1461+
) -> Result<()> {
14411462
let shapemap_reader = input
14421463
.open_read(None, "ShapeMap")
14431464
.map_err(|e| RudofError::ShapeMapParseError {
@@ -1463,7 +1484,12 @@ impl Rudof {
14631484
/// * `node` - Optional node selector string
14641485
/// * `shape` - Optional shape selector string
14651486
/// * `base` - Optional base IRI for resolving relative IRIs in node and shape selectors
1466-
pub fn add_node_shape_to_shapemap(&mut self, node: &Option<String>, shape: &Option<String>, base: &Option<IriS>) -> Result<()> {
1487+
pub fn add_node_shape_to_shapemap(
1488+
&mut self,
1489+
node: &Option<String>,
1490+
shape: &Option<String>,
1491+
base: &Option<IriS>,
1492+
) -> Result<()> {
14671493
match (node, shape) {
14681494
(None, None) => {
14691495
// Nothing to do

shex_ast/src/compact/shapemap_parser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct ShapeMapParser<'a> {
2626
impl ShapeMapParser<'_> {
2727
/// Parse a ShapeMap that uses [ShapeMap compact syntax](https://shexspec.github.io/shape-map/#grammar)
2828
///
29-
pub fn parse(
29+
pub fn parse(
3030
src: &str,
3131
nodes_prefixmap: &Option<PrefixMap>,
3232
base_nodes: &Option<IriS>,
@@ -75,7 +75,6 @@ impl ShapeMapParser<'_> {
7575
Ok(query_shapemap)
7676
}
7777

78-
7978
pub fn parse_shape_selector(str: &str) -> Result<ShapeSelector> {
8079
let span = Span::new(str);
8180
let (_, ss) = shape_spec()(span).map_err(|e| match e {

0 commit comments

Comments
 (0)