dsl: auto-impl the obvious one (hopefully)
Some checks are pending
/ build (push) Waiting to run

re foreign trait constraints
This commit is contained in:
🪞👃🪞 2025-05-23 21:47:18 +03:00
parent ddf0c05d5f
commit cbd28a5934
10 changed files with 30 additions and 24 deletions

View file

@ -1,7 +1,7 @@
//! [Content] items that modify the inherent
//! dimensions of their inner [Render]ables.
//!
//! Transform may also react to the [Area] provided.
//! Transform may also react to the [Area] taked.
//! ```
//! use ::tengri::{output::*, tui::*};
//! let area: [u16;4] = [10, 10, 20, 20];
@ -34,7 +34,7 @@ macro_rules! transform_xy {
}
#[cfg(feature = "dsl")]
impl<'n, A: 'n, T: Give<A>> Take<'n, T> for $Enum<A> {
fn provide <'source> (state: &T, token: &mut TokenIter<'source>)
fn take <'source> (state: &T, token: &mut TokenIter<'source>)
-> Perhaps<Self>
{
if let Some(Token { value: Value::Key(k), .. }) = token.peek() {
@ -80,7 +80,7 @@ macro_rules! transform_xy_unit {
}
#[cfg(feature = "dsl")]
impl<'n, A: 'n, U: Coordinate + 'n, T: Give<A> + Give<U>> Take<'n, T> for $Enum<U, A> {
fn provide <'source> (
fn take <'source> (
state: &T, token: &mut TokenIter<'source>
) -> Perhaps<Self> {
Ok(if let Some(Token { value: Value::Key($x|$y|$xy), .. }) = token.peek() {