summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhui Xie <xiezh0831@126.com>2019-09-30 22:56:05 +0800
committerMatan Kushner <hello@matchai.me>2019-09-30 23:56:05 +0900
commitc39506c6f68e91f8967e3cb3db4e0255ec5ec81d (patch)
treee0b60179a450551b335647bd6d14169ebee3f062
parent52bd37b372b8a1efcba718b0ccdddd71c4e688ee (diff)
chore: Cleanup after the config refactor (#453)
-rw-r--r--.gitignore4
-rw-r--r--Cargo.lock1
-rw-r--r--starship/src/config.rs1
-rw-r--r--starship/src/configs/rust.rs28
-rw-r--r--starship/src/module.rs9
-rw-r--r--starship_module_config_derive/Cargo.toml3
6 files changed, 4 insertions, 42 deletions
diff --git a/.gitignore b/.gitignore
index 136402868..6b06bea3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,7 @@ Cargo.lock
# Vim swap files
*.swp
+
+# Compiled files for documentation
+docs/node_modules
+docs/.vuepress/dist/
diff --git a/Cargo.lock b/Cargo.lock
index e7e382bc1..607c8d976 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -780,7 +780,6 @@ version = "0.20.0"
dependencies = [
"proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "starship 0.20.0",
"syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
diff --git a/starship/src/config.rs b/starship/src/config.rs
index 80f9fa513..6f5025179 100644
--- a/starship/src/config.rs
+++ b/starship/src/config.rs
@@ -1,4 +1,3 @@
-#![allow(dead_code)]
use crate::configs::StarshipRootConfig;
use crate::utils;
use ansi_term::{Color, Style};
diff --git a/starship/src/configs/rust.rs b/starship/src/configs/rust.rs
index 63a450a52..2bd257588 100644
--- a/starship/src/configs/rust.rs
+++ b/starship/src/configs/rust.rs
@@ -11,34 +11,6 @@ pub struct RustConfig<'a> {
pub disabled: bool,
}
-/* This is what the macro adds.
-impl<'a> ModuleConfig<'a> for RustConfig<'a> {
- fn load_config(&self, config: &'a toml::Value) -> Self {
- let mut new_module_config = self.clone();
- if let toml::Value::Table(config) = config {
- if let Some(config_str) = config.get("symbol") {
- new_module_config.symbol = new_module_config.symbol.load_config(config_str);
- }
- if let Some(config_str) = config.get("disabled") {
- new_module_config.disabled = new_module_config.disabled.load_config(config_str);
- }
- if let Some(config_str) = config.get("style") {
- new_module_config.style = new_module_config.style.load_config(config_str);
- }
- }
- new_module_config
- }
- fn from_config(config: &'a toml::Value) -> Option<Self> {
- let config = config.as_table()?;
- Some(RustConfig {
- symbol: <&'a str>::from_config(config.get("symbol")?)?,
- style: <Style>::from_config(config.get("style")?)?,
- disabled: <bool>::from_config(config.get("disabled")?)?,
- })
- }
-}
-*/
-
impl<'a> RootModuleConfig<'a> for RustConfig<'a> {
fn new() -> Self {
RustConfig {
diff --git a/starship/src/module.rs b/starship/src/module.rs
index 6d3125b1d..e1bfb97ff 100644
--- a/starship/src/module.rs
+++ b/starship/src/module.rs
@@ -204,15 +204,6 @@ impl<'a> Module<'a> {
pub fn config_value_style(&self, key: &str) -> Option<Style> {
<Style>::from_config(self.config?.as_table()?.get(key)?)
}
-
- /// Get a module's config value as a table of segment config
- #[deprecated(
- since = "0.20.0",
- note = "please use <RootModuleConfig>::try_load(module.config) instead"
- )]
- pub fn config_value_segment_config(&self, key: &str) -> Option<SegmentConfig> {
- <SegmentConfig>::from_config(self.config?.as_table()?.get(key)?)
- }
}
impl<'a> fmt::Display for Module<'a> {
diff --git a/starship_module_config_derive/Cargo.toml b/starship_module_config_derive/Cargo.toml
index 95df616ca..4dc93f870 100644
--- a/starship_module_config_derive/Cargo.toml
+++ b/starship_module_config_derive/Cargo.toml
@@ -23,6 +23,3 @@ proc-macro = true
proc-macro2 = "~1"
quote = "~1"
syn = "~1"
-
-[dev-dependencies]
-starship = { version = "0.20.0", path = "../starship" }