from -> impl_from

This commit is contained in:
same mf who else 2026-02-23 22:48:01 +02:00
parent c1b727bafc
commit d1c08df535
2 changed files with 6 additions and 6 deletions

2
dizzle

@ -1 +1 @@
Subproject commit 909b94cbd4beffb49be314724dc79db9374bcc99
Subproject commit a06838f22a400a296c92db8c9cec18b8c3ec5e1f

View file

@ -868,11 +868,11 @@ mod xywh {
use unicode_width::{UnicodeWidthStr, UnicodeWidthChar};
use rand::distributions::uniform::UniformSampler;
impl Coord for u16 { fn plus (self, other: Self) -> Self { self.saturating_add(other) } }
from!(BigBuffer: |size:(usize, usize)| Self::new(size.0, size.1));
from!(ItemTheme: |base: ItemColor| Self::from_item_color(base));
from!(ItemTheme: |base: Color| Self::from_tui_color(base));
from!(ItemColor: |rgb: Color| Self { rgb, okhsl: rgb_to_okhsl(rgb) });
from!(ItemColor: |okhsl: Okhsl<f32>| Self { okhsl, rgb: okhsl_to_rgb(okhsl) });
impl_from!(BigBuffer: |size:(usize, usize)| Self::new(size.0, size.1));
impl_from!(ItemTheme: |base: ItemColor| Self::from_item_color(base));
impl_from!(ItemTheme: |base: Color| Self::from_tui_color(base));
impl_from!(ItemColor: |rgb: Color| Self { rgb, okhsl: rgb_to_okhsl(rgb) });
impl_from!(ItemColor: |okhsl: Okhsl<f32>| Self { okhsl, rgb: okhsl_to_rgb(okhsl) });
impl_debug!(BigBuffer |self, f| { write!(f, "[BB {}x{} ({})]", self.width, self.height, self.content.len()) });
impl Tui {
pub fn new (output: Box<dyn Write + Send + Sync>) -> Usually<Self> {