mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
This commit is contained in:
parent
d330e88252
commit
c5cdbf4f07
1 changed files with 1 additions and 25 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue