Fix check for is_file, rather than !is_dir

This commit is contained in:
Azalea Colburn 2025-03-14 21:17:00 -07:00
parent 1f6e9ecf51
commit c946f80414
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ impl Query {
/// Clones self.keywords
fn transfomed_keywords(&self) -> impl Iterator<Item = String> + use<'_> {
self.keywords.iter().map(|keyword| {
if !std::path::Path::new(keyword).is_dir() {
if std::path::Path::new(keyword).is_file() {
let dirs: Vec<&str> = keyword.split("/").collect();
dirs.split_last().unwrap().1.join("/").to_string()
} else {