|
5 | 5 | // SPDX-FileCopyrightText: 2014 Benjamin Sago |
6 | 6 | // SPDX-License-Identifier: MIT |
7 | 7 | use crate::theme::ThemeFileType as FileType; |
8 | | -use crate::theme::*; |
| 8 | +use crate::theme::{FileKinds, FileNameStyle, Git, GitRepo, IconStyle, Links, Permissions, SELinuxContext, SecurityContext, Size, UiStyles, Users}; |
9 | 9 | use nu_ansi_term::{Color, Style}; |
10 | 10 | use serde::{Deserialize, Deserializer, Serialize}; |
11 | 11 | use serde_norway; |
|
49 | 49 |
|
50 | 50 | #[rustfmt::skip] |
51 | 51 | fn color_from_str(s: &str) -> Option<Color> { |
52 | | - use Color::*; |
| 52 | + use Color::{Black, Blue, Cyan, DarkGray, Default, Fixed, Green, LightBlue, LightCyan, LightGray, LightGreen, LightMagenta, LightPurple, LightRed, LightYellow, Magenta, Purple, Red, Rgb, White, Yellow}; |
53 | 53 | match s { |
54 | 54 | // nothing |
55 | 55 | "" | "none" | "None" => None, |
@@ -604,10 +604,10 @@ impl FromOverride<UiStylesOverride> for UiStyles { |
604 | 604 | } |
605 | 605 | } |
606 | 606 | impl ThemeConfig { |
607 | | - pub fn from_path(path: PathBuf) -> Self { |
| 607 | + #[must_use] pub fn from_path(path: PathBuf) -> Self { |
608 | 608 | ThemeConfig { location: path } |
609 | 609 | } |
610 | | - pub fn to_theme(&self) -> Option<UiStyles> { |
| 610 | + #[must_use] pub fn to_theme(&self) -> Option<UiStyles> { |
611 | 611 | let ui_styles_override: Option<UiStylesOverride> = { |
612 | 612 | let file = std::fs::File::open(&self.location).ok()?; |
613 | 613 | serde_norway::from_reader(&file).ok() |
@@ -650,7 +650,7 @@ mod tests { |
650 | 650 |
|
651 | 651 | #[test] |
652 | 652 | fn parse_short_hex_color_from_string() { |
653 | | - for case in ["#f0f", "#F0F"].iter() { |
| 653 | + for case in &["#f0f", "#F0F"] { |
654 | 654 | assert_eq!(color_from_str(case), Some(Color::Rgb(255, 0, 255))); |
655 | 655 | } |
656 | 656 | } |
|
0 commit comments