Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Dec 3, 2024
1 parent 895f5ff commit b4adbac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lychee-lib/src/utils/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(crate) fn resolve(
relative if dst.is_relative() => {
// Find `dst` in the parent directory of `src`
let Some(parent) = src.parent() else {
return Err(ErrorKind::InvalidFile(relative.to_path_buf()));
return Err(ErrorKind::InvalidFile(relative.clone()));
};
parent.join(relative)
}
Expand All @@ -46,7 +46,7 @@ pub(crate) fn resolve(
}
PathBuf::from(absolute)
}
_ => return Err(ErrorKind::InvalidFile(dst.to_path_buf())),
_ => return Err(ErrorKind::InvalidFile(dst.clone())),
};
Ok(Some(absolute_path(resolved)))
}
Expand Down
6 changes: 3 additions & 3 deletions lychee-lib/src/utils/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ pub(crate) fn create(
base: &Option<Base>,
extractor: &Option<BasicAuthExtractor>,
) -> HashSet<Request> {
let base = base.clone().or_else(|| Base::from_source(&source));
let base = base.clone().or_else(|| Base::from_source(source));

uris.into_iter()
.filter_map(|raw_uri| {
match create_request(&raw_uri, &source, &root_path, &base, extractor) {
match create_request(&raw_uri, source, root_path, &base, extractor) {
Ok(request) => Some(request),
Err(e) => {
warn!("Error creating request: {:?}", e);
Expand Down Expand Up @@ -197,7 +197,7 @@ fn prepend_root_path_if_absolute_local_link(text: &str, root_path: &Option<PathB
if text.starts_with('/') {
if let Some(path) = root_path {
if let Some(path_str) = path.to_str() {
return format!("{}{}", path_str, text);
return format!("{path_str}{text}");
}
}
}
Expand Down

0 comments on commit b4adbac

Please sign in to comment.