Use metadata.len() istead of metadata.size() for other platforms

Signed-off-by: hr567 <hr567@hr567.me>
This commit is contained in:
hr567 2024-06-03 15:59:23 +08:00
parent 733bef283e
commit 1727bd8e6e
Signed by: hr567
SSH Key Fingerprint: SHA256:AUrHz/3TKmc6tf4wqaaEPV/BGQ4aULSp7g76FpqujYw

View File

@ -2,7 +2,6 @@ use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap, VecDeque}; use std::collections::{BTreeMap, HashMap, VecDeque};
use std::fmt::Write; use std::fmt::Write;
use std::io; use std::io;
use std::os::unix::prelude::*;
use std::path::PathBuf; use std::path::PathBuf;
use std::rc::{Rc, Weak}; use std::rc::{Rc, Weak};
use std::sync::{ use std::sync::{
@ -61,7 +60,7 @@ async fn main() -> io::Result<()> {
let metadata = entry.metadata().await?; let metadata = entry.metadata().await?;
let task = Task { let task = Task {
file: entry.path(), file: entry.path(),
size: metadata.size() as usize, size: metadata.len() as usize,
}; };
res.push(task); res.push(task);
} }