Compare commits

..

2 commits

Author SHA1 Message Date
c5cdbf4f07 dsl: remove deprecated traits
Some checks are pending
/ build (push) Waiting to run
2025-09-08 02:03:38 +03:00
d330e88252 fix(tui): bg->fg 2025-09-08 02:03:29 +03:00
3 changed files with 2 additions and 27 deletions

View file

@ -9,7 +9,7 @@ use const_panic::PanicFmt;
use std::fmt::Debug;
pub(crate) use ::{
std::sync::Arc,
std::error::Error,
//std::error::Error,
konst::iter::for_each,
konst::string::{str_from, str_range, char_indices},
thiserror::Error,
@ -225,27 +225,3 @@ pub(crate) fn ok_flat <T> (x: Option<DslPerhaps<T>>) -> DslPerhaps<T> {
}
}
});
#[deprecated]
/// `T` + [Dsl] -> `Self`.
pub trait FromDsl<T>: Sized {
fn from_dsl (state: &T, dsl: &impl Dsl) -> Perhaps<Self>;
fn from_dsl_or (state: &T, dsl: &impl Dsl, err: Box<dyn Error>) -> Usually<Self> {
Self::from_dsl(state, dsl)?.ok_or(err)
}
fn from_dsl_or_else (state: &T, dsl: &impl Dsl, err: impl Fn()->Box<dyn Error>) -> Usually<Self> {
Self::from_dsl(state, dsl)?.ok_or_else(err)
}
}
#[deprecated]
/// `self` + [Dsl] -> `T`
pub trait DslInto<T> {
fn dsl_into (&self, dsl: &impl Dsl) -> Perhaps<T>;
fn dsl_into_or (&self, dsl: &impl Dsl, err: Box<dyn Error>) -> Usually<T> {
self.dsl_into(dsl)?.ok_or(err)
}
fn dsl_into_or_else (&self, dsl: &impl Dsl, err: impl Fn()->Box<dyn Error>) -> Usually<T> {
self.dsl_into(dsl)?.ok_or_else(err)
}
}

View file

@ -63,7 +63,7 @@ impl<T: Layout<TuiOut>> Layout<TuiOut> for TuiForeground<T> {
impl<T: Layout<TuiOut> + Draw<TuiOut>> Draw<TuiOut> for TuiForeground<T> {
fn draw (&self, to: &mut TuiOut) {
let area = self.layout(to.area());
to.fill_bg(area, self.0.0);
to.fill_fg(area, self.0.0);
to.place_at(area, &self.0.1);
}
}

View file

@ -1 +0,0 @@
use crate::*;