More linting

This commit is contained in:
Javier Feliz 2025-09-11 20:54:18 -04:00
parent 710da7de24
commit cd5386de36
5 changed files with 3 additions and 31 deletions

View File

@ -79,9 +79,9 @@ impl WaycastLauncher {
p.init();
}
self.plugins.sort_by(|a, b| b.priority().cmp(&a.priority()));
self.plugins.sort_by_key(|b| std::cmp::Reverse(b.priority()));
self.plugins_show_always
.sort_by(|a, b| b.priority().cmp(&a.priority()));
.sort_by_key(|b| std::cmp::Reverse(b.priority()));
self
}

View File

@ -1,5 +1,4 @@
mod ui;
mod util;
use gtk::prelude::*;
use gtk::Application;

View File

@ -1,26 +0,0 @@
use std::path::{Path, PathBuf};
use std::{fs, io};
pub fn get_files_with_extension<P: AsRef<Path>>(
dir: P,
extension: &str,
) -> io::Result<Vec<PathBuf>> {
let entries = fs::read_dir(dir)?;
let desktop_files: Vec<_> = entries
.filter_map(|res| res.ok())
.map(|f| f.path())
.filter(|path| {
path.extension()
.and_then(|ext| ext.to_str())
.map(|ext| ext == extension)
.unwrap_or(false)
})
.collect();
let mut files = Vec::new();
for f in desktop_files {
files.push(f);
}
Ok(files)
}

View File

@ -1 +0,0 @@
pub mod files;

View File

@ -204,7 +204,7 @@ impl FileSearchPlugin {
};
// Run the scan with a timeout
if let Err(_) = tokio::time::timeout(timeout, scan_task).await {
if tokio::time::timeout(timeout, scan_task).await.is_err() {
eprintln!("File indexing timed out after {:?}", timeout);
}
}