minor refactoring
This commit is contained in:
parent
cfa0087128
commit
1eb1bd4caa
1 changed files with 7 additions and 13 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -1465,15 +1465,10 @@ impl Application for App {
|
||||||
($name: ident, $value: expr) => {
|
($name: ident, $value: expr) => {
|
||||||
match &self.config_handler {
|
match &self.config_handler {
|
||||||
Some(config_handler) => {
|
Some(config_handler) => {
|
||||||
match paste::paste! { self.config.[<set_ $name>](config_handler, $value) } {
|
if let Err(err) =
|
||||||
Ok(_) => {}
|
paste::paste! { self.config.[<set_ $name>](config_handler, $value) }
|
||||||
Err(err) => {
|
{
|
||||||
log::warn!(
|
log::warn!("failed to save config {:?}: {}", stringify!($name), err);
|
||||||
"failed to save config {:?}: {}",
|
|
||||||
stringify!($name),
|
|
||||||
err
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
|
@ -1831,12 +1826,11 @@ impl Application for App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::LaunchUrl(url) => match open::that_detached(&url) {
|
Message::LaunchUrl(url) => {
|
||||||
Ok(()) => {}
|
if let Err(err) = open::that_detached(&url) {
|
||||||
Err(err) => {
|
|
||||||
log::warn!("failed to open {:?}: {}", url, err);
|
log::warn!("failed to open {:?}: {}", url, err);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Message::Modifiers(modifiers) => {
|
Message::Modifiers(modifiers) => {
|
||||||
self.modifiers = modifiers;
|
self.modifiers = modifiers;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue