Skip to content

Commit f03a2ab

Browse files
committed
df: fix unused imports/variables on non-Unix platforms
1 parent 3c16e36 commit f03a2ab

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/uu/df/src/df.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ where
367367
// The list of all mounted filesystems.
368368
let mounts_result = read_fs_list();
369369

370-
let (mounts, use_fallback) = match mounts_result {
370+
let (mounts, _use_fallback) = match mounts_result {
371371
Ok(m) => (m, false),
372372
Err(e) => {
373373
if opt.requires_mount_table() {
@@ -387,7 +387,7 @@ where
387387
// both the mount information and usage information.
388388
for path in paths {
389389
#[cfg(unix)]
390-
let fs_result = if use_fallback {
390+
let fs_result = if _use_fallback {
391391
Filesystem::from_path_direct(path)
392392
} else {
393393
Filesystem::from_path(&mounts, path)

src/uu/df/src/filesystem.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
//! filesystem mounted at a particular directory. It also includes
99
//! information on amount of space available and amount of space used.
1010
// spell-checker:ignore canonicalized
11+
#[cfg(unix)]
1112
use std::io;
13+
#[cfg(unix)]
1214
use std::path::PathBuf;
1315
use std::{ffi::OsString, path::Path};
1416

tests/by-util/test_df.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::collections::HashSet;
1515
#[cfg(not(any(target_os = "freebsd", target_os = "windows")))]
1616
use uutests::at_and_ucmd;
1717
use uutests::new_ucmd;
18+
#[cfg(target_os = "linux")]
1819
use uutests::util::TestScenario;
1920

2021
#[test]

0 commit comments

Comments
 (0)