From 1727bd8e6eb9777db87d8ee14385d3c2bfbb7c8e Mon Sep 17 00:00:00 2001 From: hr567 Date: Mon, 3 Jun 2024 15:59:23 +0800 Subject: [PATCH] Use metadata.len() istead of metadata.size() for other platforms Signed-off-by: hr567 --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 00d18bb..a35bc84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ use std::cell::RefCell; use std::collections::{BTreeMap, HashMap, VecDeque}; use std::fmt::Write; use std::io; -use std::os::unix::prelude::*; use std::path::PathBuf; use std::rc::{Rc, Weak}; use std::sync::{ @@ -61,7 +60,7 @@ async fn main() -> io::Result<()> { let metadata = entry.metadata().await?; let task = Task { file: entry.path(), - size: metadata.size() as usize, + size: metadata.len() as usize, }; res.push(task); }