diff --git a/src/main.rs b/src/main.rs index 567d9f6..23cdf6f 100755 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,6 @@ use std::{ rc::Rc, sync::{Arc, Mutex}, thread::JoinHandle, - time::Duration, }; use clap::{command, Parser}; @@ -156,6 +155,7 @@ fn main() -> io::Result<()> { /// - F => focus Find/Filter bar /// - N => New directory from search text /// - C => Copy selected files to this directory. +/// - C => Remove selected files and directories non-recursively /// - 1-9 or 0 => set recursive depth limit (0 = infinite) /// - T => open terminal here ($TERM) /// - E => open in editor ($EDITOR ) @@ -302,7 +302,7 @@ impl TuiFile { } pub fn new(current_dir: PathBuf) -> io::Result { // state - let (width, height) = terminal::size()?; + let (_width, _height) = terminal::size()?; let updates = u32::MAX; Ok(Self { active: true, diff --git a/src/run.rs b/src/run.rs index db28864..a72608b 100755 --- a/src/run.rs +++ b/src/run.rs @@ -4,7 +4,7 @@ use crossterm::{cursor, queue, style, terminal, ExecutableCommand}; use regex::RegexBuilder; use crate::updates::Updates; -use crate::{tasks, AppCmd, BackgroundTask, DirContent, DirContentType, Focus, Share}; +use crate::{tasks, AppCmd, DirContent, DirContentType, Focus, Share}; use std::io::Write; use std::path::PathBuf; use std::process::{Command, Stdio}; @@ -309,7 +309,7 @@ impl TuiFile { text.push(endchar); vec![text.red()] } - DirContentType::Dir { metadata } => { + DirContentType::Dir { metadata: _ } => { let filenamelen = share.size.0 as usize - 2 - text_charlen; if entry.name_charlen < filenamelen { text.push_str(&entry.name); @@ -335,7 +335,7 @@ impl TuiFile { text.push(endchar); vec![text.stylize()] } - DirContentType::File { size, metadata } => { + DirContentType::File { size, metadata: _ } => { let filenamelen = share.size.0 as usize - 3 - text_charlen - size.chars().count(); if entry.name_charlen < filenamelen { @@ -364,7 +364,7 @@ impl TuiFile { text.push(endchar); vec![text.stylize()] } - DirContentType::Symlink { metadata } => { + DirContentType::Symlink { metadata: _ } => { let filenamelen = share.size.0 as usize - 2 - text_charlen; if entry.name_charlen < filenamelen { text.push_str(&entry.name); @@ -688,7 +688,7 @@ impl TuiFile { } _ => {} }, - Event::Paste(e) => {} + Event::Paste(_e) => {} Event::Resize(w, h) => { share.size.0 = w; share.size.1 = h; diff --git a/src/tasks.rs b/src/tasks.rs index 5e85ce7..f039fba 100755 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -2,10 +2,9 @@ use std::{ collections::HashSet, fs, io, path::{Path, PathBuf}, - time::Duration, }; -use crate::{updates::Updates, BackgroundTask, Share, TuiFile}; +use crate::{BackgroundTask, Share}; pub(crate) fn task_copy( src: Vec<(PathBuf, Vec<(PathBuf, bool)>)>, @@ -78,7 +77,7 @@ fn copy_dir( pub(crate) fn task_del(paths: Vec, share: &mut Share) { share.tasks.push(BackgroundTask::new(move |status| { - let mut total: usize = paths.len(); + let total: usize = paths.len(); for path in paths { { let s = format!("rm {total}");