From d03934f668d1d405c2030685c318ba19b825c74e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 12 Mar 2024 07:21:16 +0100 Subject: [PATCH] fix lint by removing unused code --- src/windows.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/windows.rs b/src/windows.rs index 1deecde..9dc4bb9 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -2,7 +2,6 @@ use crate::{Error, TrashContext, TrashItem, TrashItemMetadata, TrashItemSize}; use std::{ borrow::Borrow, ffi::{c_void, OsStr, OsString}, - fs, io, os::windows::{ffi::OsStrExt, prelude::*}, path::PathBuf, }; @@ -304,36 +303,3 @@ thread_local! { fn ensure_com_initialized() { CO_INITIALIZER.with(|_| {}); } - -fn traverse_paths_recursively( - paths: impl IntoIterator, - collection: &mut Vec, -) -> Result<(), Error> { - for base_path in paths { - if base_path.is_file() || base_path.is_symlink() { - collection.push(base_path); - continue; - } - - let entries = match fs::read_dir(&base_path) { - Ok(entries) => entries, - Err(err) => { - let err = match err.kind() { - io::ErrorKind::NotFound | io::ErrorKind::PermissionDenied => { - Error::CouldNotAccess { target: base_path.to_string_lossy().to_string() } - } - _ => Error::Unknown { description: err.to_string() }, - }; - - return Err(err); - } - }; - - for entry in entries { - let entry = entry.map_err(|err| Error::Unknown { description: err.to_string() })?; - traverse_paths_recursively(Some(entry.path()), collection)?; - } - collection.push(base_path); - } - Ok(()) -}