diff --git a/crates/nu-protocol/src/config/output.rs b/crates/nu-protocol/src/config/output.rs index 5d4bc80eb7..0ec8351df0 100644 --- a/crates/nu-protocol/src/config/output.rs +++ b/crates/nu-protocol/src/config/output.rs @@ -45,13 +45,19 @@ impl UseAnsiColoring { } } +impl From for UseAnsiColoring { + fn from(value: bool) -> Self { + match value { + true => Self::True, + false => Self::False, + } + } +} + impl FromValue for UseAnsiColoring { fn from_value(v: Value) -> Result { if let Ok(v) = v.as_bool() { - return Ok(match v { - true => Self::True, - false => Self::False, - }); + return Ok(v.into()); } #[derive(FromValue)]