summaryrefslogtreecommitdiffstats
path: root/src/configs/singularity.rs
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2022-03-26 10:42:19 +0100
committerGitHub <noreply@github.com>2022-03-26 10:42:19 +0100
commit2d4b183fce8c9de0d9548f7087786bc919cae7b4 (patch)
tree924114efeef59bfe80a0b9f5fec4fdb7acf2800b /src/configs/singularity.rs
parent0fb421969058ec07a09f7c927dddc1258de75631 (diff)
refactor: replace module_config_derive with serde (#3786)
* refactor: replace module_config_derive with serde Changes include: * Removing `starship_module_config_derive` and replacing it with `serde::Deserialize` * Removing `RootModuleConfig::load_config`. While potentially useful, it was only used in tests. And it would require something like `serde::DeserializeSeed` which is not derived by serde. * Merging `RootModuleConfig` into `ModuleConfig` * Implementing a `ValueDeserializer` that holds a reference to a `toml::Value` in `serde_utils.rs` * Deserialization errors (invalid type) are now logged and include the current key and the struct names * Unknown keys are now considered an error. "Did you mean?"-messages are still possible * fix typo Co-authored-by: Matan Kushner <hello@matchai.dev> Co-authored-by: Matan Kushner <hello@matchai.dev>
Diffstat (limited to 'src/configs/singularity.rs')
-rw-r--r--src/configs/singularity.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/configs/singularity.rs b/src/configs/singularity.rs
index ade5901f5..e54dee929 100644
--- a/src/configs/singularity.rs
+++ b/src/configs/singularity.rs
@@ -1,9 +1,7 @@
-use crate::config::ModuleConfig;
+use serde::{Deserialize, Serialize};
-use serde::Serialize;
-use starship_module_config_derive::ModuleConfig;
-
-#[derive(Clone, ModuleConfig, Serialize)]
+#[derive(Clone, Deserialize, Serialize)]
+#[serde(default)]
pub struct SingularityConfig<'a> {
pub symbol: &'a str,
pub format: &'a str,