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) => {
|
||||
match &self.config_handler {
|
||||
Some(config_handler) => {
|
||||
match paste::paste! { self.config.[<set_ $name>](config_handler, $value) } {
|
||||
Ok(_) => {}
|
||||
Err(err) => {
|
||||
log::warn!(
|
||||
"failed to save config {:?}: {}",
|
||||
stringify!($name),
|
||||
err
|
||||
);
|
||||
}
|
||||
if let Err(err) =
|
||||
paste::paste! { self.config.[<set_ $name>](config_handler, $value) }
|
||||
{
|
||||
log::warn!("failed to save config {:?}: {}", stringify!($name), err);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
|
|
@ -1831,12 +1826,11 @@ impl Application for App {
|
|||
}
|
||||
}
|
||||
}
|
||||
Message::LaunchUrl(url) => match open::that_detached(&url) {
|
||||
Ok(()) => {}
|
||||
Err(err) => {
|
||||
Message::LaunchUrl(url) => {
|
||||
if let Err(err) = open::that_detached(&url) {
|
||||
log::warn!("failed to open {:?}: {}", url, err);
|
||||
}
|
||||
},
|
||||
}
|
||||
Message::Modifiers(modifiers) => {
|
||||
self.modifiers = modifiers;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue