summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrhun Parmaksız <orhunparmaksiz@gmail.com>2024-03-31 14:17:02 +0300
committerOrhun Parmaksız <orhunparmaksiz@gmail.com>2024-03-31 14:17:02 +0300
commitb47e91a0a25e414f9781519244fb98f5c54e9b6d (patch)
treeb4ec742588ed4063461c4f6613e41258431313aa
parent48e5ad6cc62fe498a73f8a7ece9580d0b68aeee2 (diff)
fix(lint): apply clippy suggestions
-rw-r--r--systeroid-core/src/config.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/systeroid-core/src/config.rs b/systeroid-core/src/config.rs
index 3992da7..f757c18 100644
--- a/systeroid-core/src/config.rs
+++ b/systeroid-core/src/config.rs
@@ -131,20 +131,15 @@ impl Config {
}
}
if let Some(section) = ini.section(Some("cli.colors")) {
- if let Some(default_color) = section
- .get("default_color")
- .and_then(|v| Color::try_from(v).ok())
- {
+ if let Some(default_color) = section.get("default_color").map(Color::from) {
self.cli.color.default_color = default_color;
}
for (key, value) in section.iter() {
if key.starts_with("section_") {
- if let (sysctl_section, Some(color)) = (
+ self.cli.color.section_colors.insert(
Section::from(key.trim_start_matches("section_").to_string()),
- Color::try_from(value).ok(),
- ) {
- self.cli.color.section_colors.insert(sysctl_section, color);
- }
+ Color::from(value),
+ );
}
}
}