dsl: remove deprecated traits
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-09-08 02:03:38 +03:00
parent d330e88252
commit c5cdbf4f07

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)
}
}