From 1a87a691161048ca6e9835c2cf60f8836bddfeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Wed, 7 Oct 2020 10:34:15 +0200 Subject: [PATCH] Fixes some typos --- czkawka_cli/src/commands.rs | 30 +++++++++++++++--------------- czkawka_core/src/big_file.rs | 2 +- czkawka_core/src/common_items.rs | 2 +- czkawka_core/src/duplicate.rs | 6 +++--- czkawka_core/src/empty_folder.rs | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/czkawka_cli/src/commands.rs b/czkawka_cli/src/commands.rs index a7f25b8..ab15973 100644 --- a/czkawka_cli/src/commands.rs +++ b/czkawka_cli/src/commands.rs @@ -9,10 +9,10 @@ pub enum Commands { #[structopt(flatten)] directories: Directories, #[structopt(flatten)] - excluded_directories: ExludedDirectories, + excluded_directories: ExcludedDirectories, #[structopt(flatten)] - excluded_items: ExludedItems, - #[structopt(short, long, parse(try_from_str = parse_min_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")] + excluded_items: ExcludedItems, + #[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")] min_size: u64, #[structopt(flatten)] allowed_extensions: AllowedExtensions, @@ -25,7 +25,7 @@ pub enum Commands { #[structopt(flatten)] not_recursive: NotRecursive, }, - #[structopt(name = "empty-folders", about = "Finds emtpty folders", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka empty-folders -d /home/rafal/rr /home/gateway -f results.txt")] + #[structopt(name = "empty-folders", about = "Finds empty folders", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka empty-folders -d /home/rafal/rr /home/gateway -f results.txt")] EmptyFolders { #[structopt(flatten)] directories: Directories, @@ -39,9 +39,9 @@ pub enum Commands { #[structopt(flatten)] directories: Directories, #[structopt(flatten)] - excluded_directories: ExludedDirectories, + excluded_directories: ExcludedDirectories, #[structopt(flatten)] - excluded_items: ExludedItems, + excluded_items: ExcludedItems, #[structopt(flatten)] allowed_extensions: AllowedExtensions, #[structopt(short, long, default_value = "50", help = "Number of files to be shown")] @@ -56,9 +56,9 @@ pub enum Commands { #[structopt(flatten)] directories: Directories, #[structopt(flatten)] - excluded_directories: ExludedDirectories, + excluded_directories: ExcludedDirectories, #[structopt(flatten)] - excluded_items: ExludedItems, + excluded_items: ExcludedItems, #[structopt(flatten)] allowed_extensions: AllowedExtensions, #[structopt(short = "D", long, help = "Delete found files")] @@ -73,9 +73,9 @@ pub enum Commands { #[structopt(flatten)] directories: Directories, #[structopt(flatten)] - excluded_directories: ExludedDirectories, + excluded_directories: ExcludedDirectories, #[structopt(flatten)] - excluded_items: ExludedItems, + excluded_items: ExcludedItems, #[structopt(short = "D", long, help = "Delete found files")] delete_files: bool, #[structopt(flatten)] @@ -92,14 +92,14 @@ pub struct Directories { } #[derive(Debug, StructOpt)] -pub struct ExludedDirectories { - #[structopt(short, long, parse(from_os_str), help = "Exluded directorie(s)", long_help = "List of directorie(s) which will be excluded from search(absolute path)")] +pub struct ExcludedDirectories { + #[structopt(short, long, parse(from_os_str), help = "Excluded directorie(s)", long_help = "List of directorie(s) which will be excluded from search(absolute path)")] pub excluded_directories: Vec, } #[derive(Debug, StructOpt)] -pub struct ExludedItems { - #[structopt(short = "E", long, parse(from_os_str), help = "Exluded item(s)", long_help = "List of excluded item(s) which contains * wildcard(may be slow, so use -e where possible)")] +pub struct ExcludedItems { + #[structopt(short = "E", long, parse(from_os_str), help = "Excluded item(s)", long_help = "List of excluded item(s) which contains * wildcard(may be slow, so use -e where possible)")] pub excluded_items: Vec, } @@ -155,7 +155,7 @@ fn parse_delete_method(src: &str) -> Result { } } -fn parse_min_size(src: &str) -> Result { +fn parse_minimal_file_size(src: &str) -> Result { match src.parse::() { Ok(min_size) => { if min_size > 0 { diff --git a/czkawka_core/src/big_file.rs b/czkawka_core/src/big_file.rs index 70440a6..d6d1a6f 100644 --- a/czkawka_core/src/big_file.rs +++ b/czkawka_core/src/big_file.rs @@ -278,7 +278,7 @@ impl BigFile { self.number_of_files_to_check = number_of_files_to_check; } - /// Setting excluded items which needs to contains * wildcrard + /// Setting excluded items which needs to contains * wildcard /// Are a lot of slower than absolute path, so it should be used to heavy pub fn set_excluded_items(&mut self, excluded_items: String) { self.excluded_items.set_excluded_items(excluded_items, &mut self.text_messages); diff --git a/czkawka_core/src/common_items.rs b/czkawka_core/src/common_items.rs index 4142294..0732bb8 100644 --- a/czkawka_core/src/common_items.rs +++ b/czkawka_core/src/common_items.rs @@ -10,7 +10,7 @@ impl ExcludedItems { pub fn new() -> ExcludedItems { ExcludedItems { items: vec![] } } - /// Setting excluded items which needs to contains * wildcrard + /// Setting excluded items which needs to contains * wildcard /// Are a lot of slower than absolute path, so it should be used to heavy pub fn set_excluded_items(&mut self, mut excluded_items: String, text_messages: &mut Messages) { let start_time: SystemTime = SystemTime::now(); diff --git a/czkawka_core/src/duplicate.rs b/czkawka_core/src/duplicate.rs index f984956..db7fdaa 100644 --- a/czkawka_core/src/duplicate.rs +++ b/czkawka_core/src/duplicate.rs @@ -373,7 +373,7 @@ impl DuplicateFinder { let mut hasher: blake3::Hasher = blake3::Hasher::new(); let mut buffer = [0u8; 16384]; - let mut readed_bytes: u64 = 0; + let mut read_bytes: u64 = 0; loop { let n = match file_handler.read(&mut buffer) { Ok(t) => t, @@ -387,11 +387,11 @@ impl DuplicateFinder { break; } - readed_bytes += n as u64; + read_bytes += n as u64; self.information.bytes_read_when_hashing += n as u64; hasher.update(&buffer[..n]); - if self.check_method == CheckingMethod::HashMB && readed_bytes >= HASH_MB_LIMIT_BYTES { + if self.check_method == CheckingMethod::HashMB && read_bytes >= HASH_MB_LIMIT_BYTES { break; } } diff --git a/czkawka_core/src/empty_folder.rs b/czkawka_core/src/empty_folder.rs index 120ffe9..69135cb 100644 --- a/czkawka_core/src/empty_folder.rs +++ b/czkawka_core/src/empty_folder.rs @@ -230,7 +230,7 @@ impl EmptyFolder { } } } else { - // We need to check if parent of folder isn't also empty, because we wan't to delete only parent with two empty folders except this folders and at the end parent folder + // We need to check if parent of folder isn't also empty, because we want to delete only parent with two empty folders except this folders and at the end parent folder let mut new_folders_list: BTreeMap = Default::default(); for (name, folder_entry) in folders_checked { if folder_entry.is_empty != FolderEmptiness::No && self.empty_folder_list.contains_key(&name) {