diff options
author | Zhenhui Xie <xiezh0831@yahoo.co.jp> | 2020-07-08 06:45:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-07 18:45:32 -0400 |
commit | ec76fafff08933f6f31fb99ea974bdb5ae97a0af (patch) | |
tree | bb2c822cdf291635f03d27677c419488ecf77f53 /src/configs/dotnet.rs | |
parent | 0f52b7b12e8c1a2060aa873a68032937dfa2c044 (diff) |
feat: refactor modules to use format strings (#1374)
Diffstat (limited to 'src/configs/dotnet.rs')
-rw-r--r-- | src/configs/dotnet.rs | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/src/configs/dotnet.rs b/src/configs/dotnet.rs index f6bb59e40..df5018702 100644 --- a/src/configs/dotnet.rs +++ b/src/configs/dotnet.rs @@ -1,25 +1,24 @@ -use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig}; - -use ansi_term::{Color, Style}; -use starship_module_config_derive::ModuleConfig; - -#[derive(Clone, ModuleConfig)] -pub struct DotnetConfig<'a> { - pub symbol: SegmentConfig<'a>, - pub version: SegmentConfig<'a>, - pub style: Style, - pub heuristic: bool, - pub disabled: bool, -} - -impl<'a> RootModuleConfig<'a> for DotnetConfig<'a> { - fn new() -> Self { - DotnetConfig { - symbol: SegmentConfig::new("•NET "), - version: SegmentConfig::default(), - style: Color::Blue.bold(), - heuristic: true, - disabled: false, - } - } -} +use crate::config::{ModuleConfig, RootModuleConfig};
+
+use starship_module_config_derive::ModuleConfig;
+
+#[derive(Clone, ModuleConfig)]
+pub struct DotnetConfig<'a> {
+ pub format: &'a str,
+ pub symbol: &'a str,
+ pub style: &'a str,
+ pub heuristic: bool,
+ pub disabled: bool,
+}
+
+impl<'a> RootModuleConfig<'a> for DotnetConfig<'a> {
+ fn new() -> Self {
+ DotnetConfig {
+ format: "[$symbol$version( 🎯 $tfm)]($style) ",
+ symbol: "•NET ",
+ style: "blue bold",
+ heuristic: true,
+ disabled: false,
+ }
+ }
+}
|