chore: apply recommendations from clippy
This commit is contained in:
parent
cec55dafd7
commit
8e0f1c4a09
56 changed files with 720 additions and 824 deletions
|
|
@ -103,7 +103,7 @@ impl cosmic::Application for Button {
|
|||
Task::none()
|
||||
}
|
||||
|
||||
fn view(&self) -> cosmic::Element<Msg> {
|
||||
fn view(&self) -> cosmic::Element<'_, Msg> {
|
||||
// currently, panel being anchored to the left or right is a hard
|
||||
// override for icon, later if text is updated to wrap, we may
|
||||
// use Override::Text to override this behavior
|
||||
|
|
@ -181,15 +181,15 @@ pub fn run() -> iced::Result {
|
|||
if let Ok(bytes) = fs::read_to_string(&path) {
|
||||
if let Ok(entry) = DesktopEntry::from_str(&path, &bytes, Some(&locales)) {
|
||||
desktop = Some(Desktop {
|
||||
name: entry
|
||||
.name(&locales)
|
||||
.map(|x| x.to_string())
|
||||
.unwrap_or_else(|| panic!("Desktop file '{filename}' doesn't have `Name`")),
|
||||
name: entry.name(&locales).map_or_else(
|
||||
|| panic!("Desktop file '{filename}' doesn't have `Name`"),
|
||||
|x| x.to_string(),
|
||||
),
|
||||
icon: entry.icon().map(|x| x.to_string()),
|
||||
exec: entry
|
||||
.exec()
|
||||
.map(|x| x.to_string())
|
||||
.unwrap_or_else(|| panic!("Desktop file '{filename}' doesn't have `Exec`")),
|
||||
exec: entry.exec().map_or_else(
|
||||
|| panic!("Desktop file '{filename}' doesn't have `Exec`"),
|
||||
|x| x.to_string(),
|
||||
),
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue