remove needless borrows (clippy::needless_borrows_for_generic_args)
This commit is contained in:
parent
ec5c2a1991
commit
9544ba9397
1 changed files with 6 additions and 10 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -491,17 +491,14 @@ impl App {
|
||||||
fn save_color_schemes(&mut self, color_scheme_kind: ColorSchemeKind) -> Command<Message> {
|
fn save_color_schemes(&mut self, color_scheme_kind: ColorSchemeKind) -> Command<Message> {
|
||||||
// Optimized for just saving color_schemes
|
// Optimized for just saving color_schemes
|
||||||
if let Some(ref config_handler) = self.config_handler {
|
if let Some(ref config_handler) = self.config_handler {
|
||||||
match config_handler.set(
|
if let Err(err) = config_handler.set(
|
||||||
match color_scheme_kind {
|
match color_scheme_kind {
|
||||||
ColorSchemeKind::Dark => "color_schemes_dark",
|
ColorSchemeKind::Dark => "color_schemes_dark",
|
||||||
ColorSchemeKind::Light => "color_schemes_light",
|
ColorSchemeKind::Light => "color_schemes_light",
|
||||||
},
|
},
|
||||||
&self.config.color_schemes(color_scheme_kind),
|
self.config.color_schemes(color_scheme_kind),
|
||||||
) {
|
) {
|
||||||
Ok(()) => {}
|
log::error!("failed to save config: {}", err);
|
||||||
Err(err) => {
|
|
||||||
log::error!("failed to save config: {}", err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.update_color_schemes();
|
self.update_color_schemes();
|
||||||
|
|
@ -1547,9 +1544,8 @@ impl Application for App {
|
||||||
&color_scheme,
|
&color_scheme,
|
||||||
ron::ser::PrettyConfig::new(),
|
ron::ser::PrettyConfig::new(),
|
||||||
) {
|
) {
|
||||||
Ok(ron) => match fs::write(path, &ron) {
|
Ok(ron) => {
|
||||||
Ok(()) => {}
|
if let Err(err) = fs::write(path, ron) {
|
||||||
Err(err) => {
|
|
||||||
log::error!(
|
log::error!(
|
||||||
"failed to export {:?} to {:?}: {}",
|
"failed to export {:?} to {:?}: {}",
|
||||||
color_scheme_id,
|
color_scheme_id,
|
||||||
|
|
@ -1557,7 +1553,7 @@ impl Application for App {
|
||||||
err
|
err
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
log::error!(
|
log::error!(
|
||||||
"failed to serialize color scheme {:?}: {}",
|
"failed to serialize color scheme {:?}: {}",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue