Skip to content

Commit 2fa5cee

Browse files
committed
clippy fix
1 parent 6622f3c commit 2fa5cee

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

cli/src/main.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use ontoenv::util::write_dataset_to_file;
99
use ontoenv::ToUriString;
1010
use oxigraph::io::{JsonLdProfileSet, RdfFormat};
1111
use oxigraph::model::NamedNode;
12-
use serde_json;
1312
use std::collections::{BTreeMap, BTreeSet};
1413
use std::env::current_dir;
1514
use std::path::PathBuf;
@@ -617,7 +616,7 @@ fn main() -> Result<()> {
617616
// Recompute status details similar to env.status()
618617
let ontoenv_dir = current_dir()?.join(".ontoenv");
619618
let last_updated = if ontoenv_dir.exists() {
620-
Some(std::fs::metadata(&ontoenv_dir)?.modified()?.into())
619+
Some(std::fs::metadata(&ontoenv_dir)?.modified()?)
621620
as Option<std::time::SystemTime>
622621
} else {
623622
None
@@ -847,16 +846,14 @@ fn main() -> Result<()> {
847846
}))
848847
.collect();
849848
println!("{}", serde_json::to_string_pretty(&out)?);
849+
} else if problems.is_empty() {
850+
println!("No issues found.");
850851
} else {
851-
if problems.is_empty() {
852-
println!("No issues found.");
853-
} else {
854-
println!("Found {} issues:", problems.len());
855-
for problem in problems {
856-
println!("- {}", problem.message);
857-
for location in problem.locations {
858-
println!(" - {location}");
859-
}
852+
println!("Found {} issues:", problems.len());
853+
for problem in problems {
854+
println!("- {}", problem.message);
855+
for location in problem.locations {
856+
println!(" - {location}");
860857
}
861858
}
862859
}

lib/src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl PersistentGraphIO {
282282
let mut writer = StreamingWriter::new(&self.store_path, opts);
283283

284284
let mut iter = self.store.quads_for_pattern(None, None, None, None);
285-
while let Some(q) = iter.next() {
285+
for q in iter {
286286
let q = q?;
287287
// Dataset id: reuse graph name string; Graph name: same string
288288
let gname_str = match q.graph_name {

lib/src/options.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ impl From<bool> for RefreshStrategy {
5858

5959
/// Represents the cache usage policy captured in the configuration.
6060
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
61+
#[derive(Default)]
6162
pub enum CacheMode {
6263
Enabled,
64+
#[default]
6365
Disabled,
6466
}
6567

@@ -69,11 +71,6 @@ impl CacheMode {
6971
}
7072
}
7173

72-
impl Default for CacheMode {
73-
fn default() -> Self {
74-
CacheMode::Disabled
75-
}
76-
}
7774

7875
impl From<bool> for CacheMode {
7976
fn from(value: bool) -> Self {

rdf5d/src/bin/r5tu.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
303303
Commands::Stat(args) => {
304304
let file = args.file;
305305
let f = match {
306-
#[cfg(feature = "mmap")]
307-
{
308-
if args.no_mmap {
309-
R5tuFile::open(&file)
310-
} else {
311-
R5tuFile::open_mmap(&file)
312-
}
313-
}
314-
#[cfg(not(feature = "mmap"))]
315-
{
316-
R5tuFile::open(&file)
317-
}
306+
R5tuFile::open(&file)
318307
} {
319308
Ok(f) => f,
320309
Err(e) => {

0 commit comments

Comments
 (0)