From 3cfb95668429607dde7ac36f0e4aa1c0d780535e Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 31 May 2021 16:18:33 -0500 Subject: [PATCH] refactor/du ~ fix `cargo clippy` warning (clippy::ptr_arg) --- src/uu/du/src/du.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index c5fff2ed7..d0dc845cb 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -24,6 +24,8 @@ use std::os::unix::fs::MetadataExt; use std::os::windows::fs::MetadataExt; #[cfg(windows)] use std::os::windows::io::AsRawHandle; +#[cfg(windows)] +use std::path::Path; use std::path::PathBuf; use std::time::{Duration, UNIX_EPOCH}; use uucore::InvalidEncodingHandling; @@ -159,7 +161,7 @@ fn birth_u64(meta: &Metadata) -> Option { } #[cfg(windows)] -fn get_size_on_disk(path: &PathBuf) -> u64 { +fn get_size_on_disk(path: &Path) -> u64 { let mut size_on_disk = 0; // bind file so it stays in scope until end of function @@ -191,7 +193,7 @@ fn get_size_on_disk(path: &PathBuf) -> u64 { } #[cfg(windows)] -fn get_file_info(path: &PathBuf) -> Option { +fn get_file_info(path: &Path) -> Option { let mut result = None; let file = match fs::File::open(path) {