about summary refs log tree commit diff stats
path: root/src/download
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-24 11:39:17 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-24 11:45:31 +0200
commit324ddec41d474bb4840a2b76db48b5f97ed65889 (patch)
treeb5bd36bb1a4cc59fdf4996c6b1fa90578127255b /src/download
parentfeat(cli/selectCommand/file): Allow re-use of the previous selection file (diff)
downloadyt-324ddec41d474bb4840a2b76db48b5f97ed65889.tar.gz
yt-324ddec41d474bb4840a2b76db48b5f97ed65889.zip
fix(treewide): Always display bytes in a formatted way through `Bytes`
Diffstat (limited to '')
-rw-r--r--src/download/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/download/mod.rs b/src/download/mod.rs
index ad807f6..2a19a3a 100644
--- a/src/download/mod.rs
+++ b/src/download/mod.rs
@@ -8,7 +8,7 @@
 // You should have received a copy of the License along with this program.
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-use std::{collections::HashMap, sync::Arc, time::Duration};
+use std::{collections::HashMap, str::FromStr, sync::Arc, time::Duration};
 
 use crate::{
     app::App,
@@ -24,7 +24,7 @@ use crate::{
 use anyhow::{bail, Context, Result};
 use bytes::Bytes;
 use futures::{future::BoxFuture, FutureExt};
-use log::{debug, info, warn};
+use log::{debug, error, info, warn};
 use tokio::{fs, task::JoinHandle, time};
 
 mod download_options;
@@ -156,8 +156,8 @@ impl Downloader {
         }
 
         let val = dir_size(fs::read_dir(&app.config.paths.download_dir).await?).await;
-        if let Ok(val) = val.as_ref() {
-            info!("Cache dir has a size of '{}'", val);
+        if let Ok(val) = val {
+            info!("Cache dir has a size of '{}'", Bytes::new(val));
         }
         val
     }