mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 10:40:54 +00:00
Fixed silly custom settings parsing
This commit is contained in:
parent
f54ab73b47
commit
c72b70d4ae
1 changed files with 0 additions and 31 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue