diff --git a/README.md b/README.md index 90ba7f0a..afb36b3c 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ The benchmark was generated by [a GitHub Workflow](https://github.com/KSXGitHub/ ## Limitations * Ignorant of reflinks (from COW filesystems such as BTRFS and ZFS). -* Do not follow symbolic links. -* Do not differentiate filesystem: Mounted folders are counted as normal folders. +* Does not follow symbolic links. +* Does not differentiate filesystems: Mounted folders are counted as normal folders. * The runtime is optimized at the expense of binary size. ## Usage @@ -134,7 +134,7 @@ The [parallel-disk-usage crate](https://crates.io/crates/parallel-disk-usage) is Alternatively, the `pdu` command provides `--json-input` flag and `--json-output` flag. The `--json-output` flag converts disk usage data into JSON and the `--json-input` flag turns said JSON into visualization. These 2 flags allow integration with other CLI tools (via pipe, as per the UNIX philosophy). -Beware that the structure of the JSON tree differs depends on the number of file/directory names that were provided (as CLI arguments): +Beware that the structure of the JSON tree differs depending on the number of file/directory names that were provided (as CLI arguments): * If there are only 0 or 1 file/directory names, the name of the tree root would be a real path (either `.` or the provided name). * If there are 2 or more file/directory names, the name of the tree root would be `(total)` (which is not a real path), and the provided names would correspond to the children of the tree root. diff --git a/src/app.rs b/src/app.rs index 7fad5b51..4ad14aa5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -158,7 +158,7 @@ impl App { if cfg!(unix) && self.args.deduplicate_hardlinks && self.args.files.len() > 1 { // Hardlinks deduplication doesn't work properly if there are more than 1 paths pointing to // the same tree or if a path points to a subtree of another path. Therefore, we must find - // and remove such overlapping paths before they cause problem. + // and remove such overlapping paths before they cause problems. use overlapping_arguments::{remove_overlapping_paths, RealApi}; remove_overlapping_paths::(&mut self.args.files); } diff --git a/src/app/overlapping_arguments.rs b/src/app/overlapping_arguments.rs index f8ff31f6..f452bb06 100644 --- a/src/app/overlapping_arguments.rs +++ b/src/app/overlapping_arguments.rs @@ -43,7 +43,7 @@ impl Api for RealApi { /// Hardlinks deduplication doesn't work properly if there are more than 1 paths pointing to /// the same tree or if a path points to a subtree of another path. Therefore, we must find -/// and remove such overlapping paths before they cause problem. +/// and remove such overlapping paths before they cause problems. pub fn remove_overlapping_paths(arguments: &mut Vec) { let to_remove = find_overlapping_paths_to_remove::(arguments); remove_items_from_vec_by_indices(arguments, &to_remove); @@ -102,14 +102,14 @@ pub fn remove_items_from_vec_by_indices(vec: &mut Vec, indices: &Has return; } - // Optimization: If there is only 1 element to remove, shifting elements would be cheaper than reallocate a whole array. + // Optimization: If there is only 1 element to remove, shifting elements would be cheaper than reallocating a whole array. if indices.len() == 1 { let index = *indices.iter().next().unwrap(); vec.remove(index); return; } - // Default: If there are more than 1 elements to remove, just copy the whole array without them. + // Default: If there are more than 1 element to remove, just copy the whole array without them. *vec = vec .pipe(take) .into_iter() diff --git a/src/args/threads.rs b/src/args/threads.rs index 44dc44aa..44810350 100644 --- a/src/args/threads.rs +++ b/src/args/threads.rs @@ -18,7 +18,7 @@ pub enum Threads { Fixed(NonZeroUsize), } -/// Error that occurs when parsing a string to as [`Threads`]. +/// Error that occurs when parsing a string as [`Threads`]. #[derive(Debug, Display, Clone, PartialEq, Eq, Error)] #[non_exhaustive] pub enum FromStrError { diff --git a/src/fs_tree_builder.rs b/src/fs_tree_builder.rs index bddcfbab..37167b2c 100644 --- a/src/fs_tree_builder.rs +++ b/src/fs_tree_builder.rs @@ -52,7 +52,7 @@ where pub hardlinks_recorder: &'a HardlinksRecorder, /// Reports progress to external system. pub reporter: &'a Report, - /// Deepest level of descendent display in the graph. The sizes beyond the max depth still count toward total. + /// Deepest level of descendant display in the graph. The sizes beyond the max depth still count toward total. pub max_depth: u64, } diff --git a/src/tree_builder.rs b/src/tree_builder.rs index c6e1494d..5f82572b 100644 --- a/src/tree_builder.rs +++ b/src/tree_builder.rs @@ -23,7 +23,7 @@ where pub get_info: GetInfo, /// Function to join parent's `path` with a child's name to make the child's `name`. pub join_path: JoinPath, - /// Deepest level of descendent to store as arrays. The sizes beyond the max depth still count toward total. + /// Deepest level of descendant to store as arrays. The sizes beyond the max depth still count toward total. pub max_depth: u64, } diff --git a/src/visualizer/methods.rs b/src/visualizer/methods.rs index 919a06f0..f4e99d62 100644 --- a/src/visualizer/methods.rs +++ b/src/visualizer/methods.rs @@ -22,7 +22,7 @@ where Name: Display, Size: size::Size + Into, { - /// Create ASCII rows that visualize of the [tree](crate::data_tree::DataTree), such rows + /// Create ASCII rows that visualize the [tree](crate::data_tree::DataTree), such rows /// are meant to be printed to a terminal screen. pub fn rows(mut self) -> Vec { let initial_table = render_initial(self);