diff --git a/lychee-lib/src/utils/path.rs b/lychee-lib/src/utils/path.rs index 3d86259157..daa4f7fde6 100644 --- a/lychee-lib/src/utils/path.rs +++ b/lychee-lib/src/utils/path.rs @@ -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) } @@ -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))) } diff --git a/lychee-lib/src/utils/request.rs b/lychee-lib/src/utils/request.rs index d5e002f162..8089eddf80 100644 --- a/lychee-lib/src/utils/request.rs +++ b/lychee-lib/src/utils/request.rs @@ -140,11 +140,11 @@ pub(crate) fn create( base: &Option, extractor: &Option, ) -> HashSet { - 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); @@ -197,7 +197,7 @@ fn prepend_root_path_if_absolute_local_link(text: &str, root_path: &Option