Clippy is a sick tool
This commit is contained in:
parent
0cd68cb58c
commit
85ce87449f
@ -15,11 +15,7 @@ impl LauncherListItem for DesktopEntry {
|
||||
id: self.id.clone(),
|
||||
title: self.name.to_owned(),
|
||||
description: {
|
||||
if let Some(glib_string) = &self.description {
|
||||
Some(glib_string.to_string().to_owned())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.description.as_ref().map(|glib_string| glib_string.to_string().to_owned())
|
||||
},
|
||||
icon: {
|
||||
if let Some(icon) = &self.icon {
|
||||
@ -57,11 +53,11 @@ pub fn get_desktop_entries() -> Vec<DesktopEntry> {
|
||||
let mut entries = Vec::new();
|
||||
|
||||
for i in gio::AppInfo::all() {
|
||||
let info: gio::DesktopAppInfo;
|
||||
match i.downcast_ref::<gio::DesktopAppInfo>() {
|
||||
Some(inf) => info = inf.to_owned(),
|
||||
|
||||
let info: gio::DesktopAppInfo = match i.downcast_ref::<gio::DesktopAppInfo>() {
|
||||
Some(inf) => inf.to_owned(),
|
||||
None => continue,
|
||||
}
|
||||
};
|
||||
if !info.should_show() {
|
||||
continue;
|
||||
}
|
||||
@ -83,6 +79,12 @@ pub fn get_desktop_entries() -> Vec<DesktopEntry> {
|
||||
|
||||
pub struct DrunPlugin;
|
||||
|
||||
impl Default for DrunPlugin {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl DrunPlugin {
|
||||
pub fn new() -> Self {
|
||||
DrunPlugin
|
||||
|
@ -18,9 +18,9 @@ struct FileEntry {
|
||||
|
||||
impl FileEntry {
|
||||
fn from(entry: DirEntry) -> Self {
|
||||
return FileEntry {
|
||||
FileEntry {
|
||||
path: entry.into_path(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,10 +82,8 @@ pub fn default_search_list() -> Vec<PathBuf> {
|
||||
ud.video_dir(),
|
||||
];
|
||||
|
||||
for d in user_dirs {
|
||||
if let Some(path) = d {
|
||||
paths.push(path.to_path_buf());
|
||||
}
|
||||
for path in user_dirs.into_iter().flatten() {
|
||||
paths.push(path.to_path_buf());
|
||||
}
|
||||
|
||||
return paths;
|
||||
@ -101,6 +99,12 @@ pub struct FileSearchPlugin {
|
||||
files: Arc<Mutex<Vec<FileEntry>>>,
|
||||
}
|
||||
|
||||
impl Default for FileSearchPlugin {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl FileSearchPlugin {
|
||||
pub fn new() -> Self {
|
||||
FileSearchPlugin {
|
||||
|
Loading…
x
Reference in New Issue
Block a user