mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 19:56:44 +01:00
Compare commits
2 commits
a4dbf88220
...
c5cdbf4f07
| Author | SHA1 | Date | |
|---|---|---|---|
| c5cdbf4f07 | |||
| d330e88252 |
3 changed files with 2 additions and 27 deletions
|
|
@ -9,7 +9,7 @@ use const_panic::PanicFmt;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
pub(crate) use ::{
|
pub(crate) use ::{
|
||||||
std::sync::Arc,
|
std::sync::Arc,
|
||||||
std::error::Error,
|
//std::error::Error,
|
||||||
konst::iter::for_each,
|
konst::iter::for_each,
|
||||||
konst::string::{str_from, str_range, char_indices},
|
konst::string::{str_from, str_range, char_indices},
|
||||||
thiserror::Error,
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ impl<T: Layout<TuiOut>> Layout<TuiOut> for TuiForeground<T> {
|
||||||
impl<T: Layout<TuiOut> + Draw<TuiOut>> Draw<TuiOut> for TuiForeground<T> {
|
impl<T: Layout<TuiOut> + Draw<TuiOut>> Draw<TuiOut> for TuiForeground<T> {
|
||||||
fn draw (&self, to: &mut TuiOut) {
|
fn draw (&self, to: &mut TuiOut) {
|
||||||
let area = self.layout(to.area());
|
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);
|
to.place_at(area, &self.0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
use crate::*;
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue