1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

Update src/uu/wc/src/count_fast.rs

Co-authored-by: Sylvestre Ledru <sledru@mozilla.com>
This commit is contained in:
Yury Zhytkou 2023-12-07 12:13:34 -05:00 committed by GitHub
parent 967c539cc6
commit 0076c9f64c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,12 +173,11 @@ pub(crate) fn count_bytes_fast<T: WordCountable>(handle: &mut T) -> (usize, Opti
if let Some(file) = handle.inner_file() {
if let Ok(metadata) = file.metadata() {
let attributes = metadata.file_attributes();
let size = metadata.file_size();
if (attributes & FILE_ATTRIBUTE_ARCHIVE) != 0
|| (attributes & FILE_ATTRIBUTE_NORMAL) != 0
{
return (size as usize, None);
return (metadata.file_size() as usize, None);
}
}
}