implemented for loops

This commit is contained in:
2025-04-20 05:16:50 -04:00
parent d741854f5f
commit 11353b2d69
27 changed files with 360 additions and 174 deletions

View File

@@ -127,7 +127,7 @@ impl StyleSet {
Self { styles: vec![] }
}
pub fn add(mut self, style: Style) -> Self {
pub fn add_style(mut self, style: Style) -> Self {
if !self.styles.contains(&style) {
self.styles.push(style);
}
@@ -149,7 +149,7 @@ impl BitOr for Style {
type Output = StyleSet;
fn bitor(self, rhs: Self) -> Self::Output {
StyleSet::new().add(self).add(rhs)
StyleSet::new().add_style(self).add_style(rhs)
}
}
@@ -158,12 +158,12 @@ impl BitOr<Style> for StyleSet {
type Output = StyleSet;
fn bitor(self, rhs: Style) -> Self::Output {
self.add(rhs)
self.add_style(rhs)
}
}
impl From<Style> for StyleSet {
fn from(style: Style) -> Self {
StyleSet::new().add(style)
StyleSet::new().add_style(style)
}
}