Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Feb 14, 2025
1 parent 6106734 commit b78ec76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/buildlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ async fn query_drv_path(settings: &web::Data<Config>, drv: &str) -> Result<Optio

pub fn get_build_log(store: &Path, drv_path: &Path) -> Option<PathBuf> {
let drv_name = drv_path.file_name()?.as_bytes();
let log_path = match store.parent().map(|p| {
let log_path = store.parent().map(|p| {
p.join("var")
.join("log")
.join("nix")
.join("drvs")
.join(OsStr::from_bytes(&drv_name[0..2]))
.join(OsStr::from_bytes(&drv_name[2..]))
}) {
Some(log_path) => log_path,
None => return None,
};
})?;
if log_path.exists() {
return Some(log_path);
}
Expand Down
2 changes: 1 addition & 1 deletion src/nar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ pub(crate) async fn get(
while let Some(Ok(data)) = rx2.recv().await {
let len = data.len() as u64;
if send + len > offset {
let start = if send < offset { offset - send } else { 0 };
let start = offset.saturating_sub(send);
let end = if send + data.len() as u64 > offset + rlength {
start + rlength
} else {
Expand Down

0 comments on commit b78ec76

Please sign in to comment.