Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tl-hbk committed Dec 1, 2024
1 parent edfbf3e commit f6f6212
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/rattler_repodata_gateway/src/sparse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,14 @@ impl SparseRepoData {
path: impl AsRef<Path>,
patch_function: Option<fn(&mut PackageRecord)>,
) -> Result<Self, io::Error> {
if !path.as_ref().exists() {
Err(io::Error::new(
io::ErrorKind::NotFound,
format!("file not found: {:?}", path.as_ref()),
))
} else {
if path.as_ref().exists() {
let lock_file_path = path.as_ref().with_extension("lock");
if !lock_file_path.exists() {
OpenOptions::new()
.read(true)
.write(true)
.create(true)
.truncate(false)
.open(&lock_file_path)?;
}
let lock_file = LockedFile::open_ro(lock_file_path, "repodata cache")
Expand All @@ -135,13 +131,18 @@ impl SparseRepoData {
memory_map,

Check warning on line 131 in crates/rattler_repodata_gateway/src/sparse/mod.rs

View workflow job for this annotation

GitHub Actions / Format, Lint and Test the Python bindings

Diff in /home/runner/work/rattler/rattler/crates/rattler_repodata_gateway/src/sparse/mod.rs

Check warning on line 131 in crates/rattler_repodata_gateway/src/sparse/mod.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler/rattler/crates/rattler_repodata_gateway/src/sparse/mod.rs
repo_data_builder: |memory_map| serde_json::from_slice(memory_map.as_ref()),
}
.try_build()?,
.try_build()?,
),
subdir: subdir.into(),
channel,
patch_record_fn: patch_function,
_lock: Some(lock_file),
})
} else {
Err(io::Error::new(
io::ErrorKind::NotFound,
format!("file not found: {:?}", path.as_ref()),
))
}
}

Expand Down

0 comments on commit f6f6212

Please sign in to comment.