More linting
This commit is contained in:
parent
710da7de24
commit
cd5386de36
@ -79,9 +79,9 @@ impl WaycastLauncher {
|
|||||||
p.init();
|
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
|
self.plugins_show_always
|
||||||
.sort_by(|a, b| b.priority().cmp(&a.priority()));
|
.sort_by_key(|b| std::cmp::Reverse(b.priority()));
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
mod ui;
|
mod ui;
|
||||||
mod util;
|
|
||||||
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::Application;
|
use gtk::Application;
|
||||||
|
@ -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)
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
pub mod files;
|
|
@ -204,7 +204,7 @@ impl FileSearchPlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Run the scan with a timeout
|
// 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);
|
eprintln!("File indexing timed out after {:?}", timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user