From c72b70d4ae96ce21c236e755335b8f75746c692e Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 20 Apr 2023 17:33:06 -0700 Subject: [PATCH] Fixed silly custom settings parsing --- crates/settings/src/settings.rs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/crates/settings/src/settings.rs b/crates/settings/src/settings.rs index 285e06c2c8..5c3ee7180b 100644 --- a/crates/settings/src/settings.rs +++ b/crates/settings/src/settings.rs @@ -263,44 +263,13 @@ pub struct TerminalSettings { #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema, Default)] #[serde(rename_all = "snake_case")] -#[serde(untagged)] pub enum TerminalLineHeight { #[default] - #[serde(deserialize_with = "comfortable")] Comfortable, - #[serde(deserialize_with = "standard")] Standard, Custom(f32), } -// Copied from: https://github.com/serde-rs/serde/issues/1158#issuecomment-365362959 -fn comfortable<'de, D>(deserializer: D) -> Result<(), D::Error> -where - D: Deserializer<'de>, -{ - #[derive(Deserialize)] - enum Helper { - #[serde(rename = "comfortable")] - Variant, - } - Helper::deserialize(deserializer)?; - Ok(()) -} - -// Copied from: https://github.com/serde-rs/serde/issues/1158#issuecomment-365362959 -fn standard<'de, D>(deserializer: D) -> Result<(), D::Error> -where - D: Deserializer<'de>, -{ - #[derive(Deserialize)] - enum Helper { - #[serde(rename = "standard")] - Variant, - } - Helper::deserialize(deserializer)?; - Ok(()) -} - impl TerminalLineHeight { fn value(&self) -> f32 { match self {