Skip to content

Commit

Permalink
df: cleanup and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
crazystylus committed Feb 27, 2022
1 parent f9aa870 commit 52a8e2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uu/df/src/df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ fn filter_mount_list(vmi: Vec<MountInfo>, opt: &Options) -> Vec<MountInfo> {
/// Assign 1 `MountInfo` entry to each path
/// `lofs` entries are skipped and dummy mount points are skipped
/// Only the longest matching prefix for that path is considered
/// `lofs` is for Solaris style loopback filesystem and is present in Solaris and FreeBSD.
/// It works similar to symlinks
fn get_point_list(vmi: &[MountInfo], paths: &[String]) -> Vec<MountInfo> {
// Choose MountInfo per input_path
// Skip lofs, skip dummy and select longest match
paths
.iter()
.map(|p| {
Expand Down
1 change: 1 addition & 0 deletions tests/by-util/test_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn test_order_same() {
}

/// Test of mount point begin repeated
#[cfg(unix)]
#[test]
fn test_output_mp_repeat() {
let output1 = new_ucmd!().arg("/").arg("/").succeeds().stdout_move_str();
Expand Down

0 comments on commit 52a8e2c

Please sign in to comment.