From 7a8365c0174ddee65bd15ccca5dd7b03f110e002 Mon Sep 17 00:00:00 2001 From: same mf who else Date: Fri, 20 Feb 2026 22:58:23 +0200 Subject: [PATCH] refactor: Namespace::resolve* -> Namespace::namespace* --- output/src/lib.rs | 28 ++++++++++++++-------------- tui/src/lib.rs | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/output/src/lib.rs b/output/src/lib.rs index da9e1bf..d5a9c6d 100644 --- a/output/src/lib.rs +++ b/output/src/lib.rs @@ -189,12 +189,12 @@ pub fn evaluate_output_expression <'a, O: Out + 'a, S> ( match frags.next() { Some("when") => output.place(&When::new( - state.resolve(arg0?)?.unwrap(), + state.namespace(arg0?)?.unwrap(), Thunk::new(move|output: &mut O|state.view(output, &arg1).unwrap()) )), Some("either") => output.place(&Either::new( - state.resolve(arg0?)?.unwrap(), + state.namespace(arg0?)?.unwrap(), Thunk::new(move|output: &mut O|state.view(output, &arg1).unwrap()), Thunk::new(move|output: &mut O|state.view(output, &arg2).unwrap()) )), @@ -242,9 +242,9 @@ pub fn evaluate_output_expression <'a, O: Out + 'a, S> ( let arg = match axis { Some("x") | Some("y") => arg1, Some("xy") | None => arg2, _ => panic!("fixed: unsupported axis {axis:?}") }; let cb = Thunk::new(move|output: &mut O|state.view(output, &arg).unwrap()); match axis { - Some("xy") | None => Fixed::XY(state.resolve(arg0?)?.unwrap(), state.resolve(arg1?)?.unwrap(), cb), - Some("x") => Fixed::X(state.resolve(arg0?)?.unwrap(), cb), - Some("y") => Fixed::Y(state.resolve(arg0?)?.unwrap(), cb), + Some("xy") | None => Fixed::XY(state.namespace(arg0?)?.unwrap(), state.namespace(arg1?)?.unwrap(), cb), + Some("x") => Fixed::X(state.namespace(arg0?)?.unwrap(), cb), + Some("y") => Fixed::Y(state.namespace(arg0?)?.unwrap(), cb), frag => unimplemented!("fixed/{frag:?} ({expr:?}) ({head:?}) ({:?})", head.src()?.unwrap_or_default().split("/").next()) } @@ -255,9 +255,9 @@ pub fn evaluate_output_expression <'a, O: Out + 'a, S> ( let arg = match axis { Some("x") | Some("y") => arg1, Some("xy") | None => arg2, _ => panic!("fixed: unsupported axis {axis:?}") }; let cb = Thunk::new(move|output: &mut O|state.view(output, &arg).unwrap()); match axis { - Some("xy") | None => Min::XY(state.resolve(arg0?)?.unwrap(), state.resolve(arg1?)?.unwrap(), cb), - Some("x") => Min::X(state.resolve(arg0?)?.unwrap(), cb), - Some("y") => Min::Y(state.resolve(arg0?)?.unwrap(), cb), + Some("xy") | None => Min::XY(state.namespace(arg0?)?.unwrap(), state.namespace(arg1?)?.unwrap(), cb), + Some("x") => Min::X(state.namespace(arg0?)?.unwrap(), cb), + Some("y") => Min::Y(state.namespace(arg0?)?.unwrap(), cb), frag => unimplemented!("min/{frag:?}") } }), @@ -267,9 +267,9 @@ pub fn evaluate_output_expression <'a, O: Out + 'a, S> ( let arg = match axis { Some("x") | Some("y") => arg1, Some("xy") | None => arg2, _ => panic!("fixed: unsupported axis {axis:?}") }; let cb = Thunk::new(move|output: &mut O|state.view(output, &arg).unwrap()); match axis { - Some("xy") | None => Max::XY(state.resolve(arg0?)?.unwrap(), state.resolve(arg1?)?.unwrap(), cb), - Some("x") => Max::X(state.resolve(arg0?)?.unwrap(), cb), - Some("y") => Max::Y(state.resolve(arg0?)?.unwrap(), cb), + Some("xy") | None => Max::XY(state.namespace(arg0?)?.unwrap(), state.namespace(arg1?)?.unwrap(), cb), + Some("x") => Max::X(state.namespace(arg0?)?.unwrap(), cb), + Some("y") => Max::Y(state.namespace(arg0?)?.unwrap(), cb), frag => unimplemented!("max/{frag:?}") } }), @@ -279,9 +279,9 @@ pub fn evaluate_output_expression <'a, O: Out + 'a, S> ( let arg = match axis { Some("x") | Some("y") => arg1, Some("xy") | None => arg2, _ => panic!("fixed: unsupported axis {axis:?}") }; let cb = Thunk::new(move|output: &mut O|state.view(output, &arg).unwrap()); match axis { - Some("xy") | None => Push::XY(state.resolve(arg0?)?.unwrap(), state.resolve(arg1?)?.unwrap(), cb), - Some("x") => Push::X(state.resolve(arg0?)?.unwrap(), cb), - Some("y") => Push::Y(state.resolve(arg0?)?.unwrap(), cb), + Some("xy") | None => Push::XY(state.namespace(arg0?)?.unwrap(), state.namespace(arg1?)?.unwrap(), cb), + Some("x") => Push::X(state.namespace(arg0?)?.unwrap(), cb), + Some("y") => Push::Y(state.namespace(arg0?)?.unwrap(), cb), frag => unimplemented!("push/{frag:?}") } }), diff --git a/tui/src/lib.rs b/tui/src/lib.rs index 8e5aa42..f51d7a2 100644 --- a/tui/src/lib.rs +++ b/tui/src/lib.rs @@ -262,7 +262,7 @@ pub fn tui_input + Send + Sync + 'static> ( Some("fg") => { let arg0 = arg0?.expect("fg: expected arg 0 (color)"); output.place(&Tui::fg( - Namespace::::resolve(state, arg0)?.unwrap_or_else(||panic!("fg: {arg0:?}: not a color")), + Namespace::::namespace(state, arg0)?.unwrap_or_else(||panic!("fg: {arg0:?}: not a color")), Thunk::new(move|output: &mut TuiOut|state.view(output, &arg1).unwrap()), )) }, @@ -270,7 +270,7 @@ pub fn tui_input + Send + Sync + 'static> ( Some("bg") => { let arg0 = arg0?.expect("bg: expected arg 0 (color)"); output.place(&Tui::bg( - Namespace::::resolve(state, arg0)?.unwrap_or_else(||panic!("bg: {arg0:?}: not a color")), + Namespace::::namespace(state, arg0)?.unwrap_or_else(||panic!("bg: {arg0:?}: not a color")), Thunk::new(move|output: &mut TuiOut|state.view(output, &arg1).unwrap()), )) },