mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
refactor/du ~ fix cargo clippy
warning (clippy::ptr_arg)
This commit is contained in:
parent
5553416b87
commit
3cfb956684
1 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,8 @@ use std::os::unix::fs::MetadataExt;
|
||||||
use std::os::windows::fs::MetadataExt;
|
use std::os::windows::fs::MetadataExt;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use std::os::windows::io::AsRawHandle;
|
use std::os::windows::io::AsRawHandle;
|
||||||
|
#[cfg(windows)]
|
||||||
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
use uucore::InvalidEncodingHandling;
|
use uucore::InvalidEncodingHandling;
|
||||||
|
@ -159,7 +161,7 @@ fn birth_u64(meta: &Metadata) -> Option<u64> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn get_size_on_disk(path: &PathBuf) -> u64 {
|
fn get_size_on_disk(path: &Path) -> u64 {
|
||||||
let mut size_on_disk = 0;
|
let mut size_on_disk = 0;
|
||||||
|
|
||||||
// bind file so it stays in scope until end of function
|
// 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)]
|
#[cfg(windows)]
|
||||||
fn get_file_info(path: &PathBuf) -> Option<FileInfo> {
|
fn get_file_info(path: &Path) -> Option<FileInfo> {
|
||||||
let mut result = None;
|
let mut result = None;
|
||||||
|
|
||||||
let file = match fs::File::open(path) {
|
let file = match fs::File::open(path) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue