Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove blanket `From<&str>` impl for `Hsla`
Marshall Bowersb8547e926de4
diff --git a/crates/gpui2/src/color.rs b/crates/gpui2/src/color.rsindex 44b084e65f0..db072594760 100644--- a/crates/gpui2/src/color.rs+++ b/crates/gpui2/src/color.rs@@ -233,12 +233,6 @@ impl Hsla {}}-impl From<&str> for Hsla {- fn from(s: &str) -> Self {- Rgba::try_from(s).unwrap().into()- }-}-// impl From<Hsla> for Rgba {// fn from(value: Hsla) -> Self {// let h = value.h;diff --git a/crates/theme2/src/default_colors.rs b/crates/theme2/src/default_colors.rsindex 904e275c845..8bb1111727a 100644--- a/crates/theme2/src/default_colors.rs+++ b/crates/theme2/src/default_colors.rs@@ -4,6 +4,7 @@ use crate::{colors::{GitStatusColors, PlayerColor, PlayerColors, StatusColors, SystemColors, ThemeColors},scale::{ColorScaleSet, ColorScales},syntax::SyntaxTheme,+ ColorScaleStep,};fn neutral() -> DefaultColorScaleSet {@@ -291,22 +292,21 @@ struct DefaultColorScaleSet {dark_alpha: [&'static str; 12],}-// See [ColorScaleSet] for why we use index-1.impl DefaultColorScaleSet {- pub fn light(&self, index: usize) -> Hsla {- self.light[index - 1].into()+ pub fn light(&self, index: ColorScaleStep) -> Hsla {+ Rgba::try_from(self.light[index - 1]).unwrap().into()}- pub fn light_alpha(&self, index: usize) -> Hsla {- self.light_alpha[index - 1].into()+ pub fn light_alpha(&self, index: ColorScaleStep) -> Hsla {+ Rgba::try_from(self.light_alpha[index - 1]).unwrap().into()}- pub fn dark(&self, index: usize) -> Hsla {- self.dark[index - 1].into()+ pub fn dark(&self, index: ColorScaleStep) -> Hsla {+ Rgba::try_from(self.dark[index - 1]).unwrap().into()}- pub fn dark_alpha(&self, index: usize) -> Hsla {- self.dark_alpha[index - 1].into()+ pub fn dark_alpha(&self, index: ColorScaleStep) -> Hsla {+ Rgba::try_from(self.dark_alpha[index - 1]).unwrap().into()}}