diff --git a/src/exec/deleted.rs b/src/exec/deleted.rs index b40a266d..8a1df667 100644 --- a/src/exec/deleted.rs +++ b/src/exec/deleted.rs @@ -15,7 +15,6 @@ // For the full copyright and license information, please view the LICENSE file // that was distributed with this source code. -use std::collections::LinkedList; use std::path::{Path, PathBuf}; use rayon::Scope; @@ -155,14 +154,14 @@ impl RecurseBehindDeletedDir { from_requested_dir, skim_tx, ) { - Ok(res) if !res.vec_dirs.is_empty() => LinkedList::from([res]), + Ok(res) if !res.vec_dirs.is_empty() => Vec::from([res]), _ => return Ok(()), } } None => return Err(HttmError::new("Not a valid directory name!").into()), }; - while let Some(item) = queue.pop_back() { + while let Some(item) = queue.pop() { item.vec_dirs .into_iter() .take_while(|_| { @@ -183,7 +182,7 @@ impl RecurseBehindDeletedDir { .try_for_each(|res| { res.map(|item| { if !item.vec_dirs.is_empty() { - queue.push_back(item) + queue.push(item) } }) })? diff --git a/src/exec/recursive.rs b/src/exec/recursive.rs index 709074eb..1d36a139 100644 --- a/src/exec/recursive.rs +++ b/src/exec/recursive.rs @@ -15,7 +15,6 @@ // For the full copyright and license information, please view the LICENSE file // that was distributed with this source code. -use std::collections::LinkedList; use std::ops::Deref; use std::{fs::read_dir, path::Path, sync::Arc}; @@ -91,15 +90,13 @@ impl RecursiveMainLoop { // runs once for non-recursive but also "primes the pump" // for recursive to have items available, also only place an // error can stop execution - let mut queue: LinkedList = - Self::enter_directory(requested_dir, opt_deleted_scope, skim_tx, hangup_rx)? - .into_iter() - .collect(); + let mut queue: Vec = + Self::enter_directory(requested_dir, opt_deleted_scope, skim_tx, hangup_rx)?; if GLOBAL_CONFIG.opt_recursive { // condition kills iter when user has made a selection // pop_back makes this a LIFO queue which is supposedly better for caches - while let Some(item) = queue.pop_back() { + while let Some(item) = queue.pop() { // check -- should deleted threads keep working? // exit/error on disconnected channel, which closes // at end of browse scope