From 79f9cfcbf93db626d031ab86abbbdf5c29d80a48 Mon Sep 17 00:00:00 2001 From: facile pop culture reference Date: Sat, 19 Sep 2026 10:11:27 +0300 Subject: [PATCH] use err! macro --- dizzle | 2 +- src/layout/axis.rs | 14 +++++++------- src/term.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dizzle b/dizzle index 11d47d8..2ffea53 160000 --- a/dizzle +++ b/dizzle @@ -1 +1 @@ -Subproject commit 11d47d8647093c396f3067035eb66a1229d1a373 +Subproject commit 2ffea53c34c7b12d5149293027d58a114fc4ef7b diff --git a/src/layout/axis.rs b/src/layout/axis.rs index 5d1767b..ff66ffc 100644 --- a/src/layout/axis.rs +++ b/src/layout/axis.rs @@ -143,7 +143,7 @@ where Some("full/x") | Some("full/w") => Full::W(thunk).draw(to)?, Some("full/y") | Some("full/h") => Full::H(thunk).draw(to)?, Some("full/xy") | Some("full/wh") => Full::WH(thunk).draw(to)?, - frag => return Err(format!("full: invalid variant: {frag:?}").into()) + frag => return err!("full: invalid variant: {frag:?}") }) } @@ -169,7 +169,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("exact: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("exact: invalid variant: {:?}", expr.head()?) }) } @@ -195,7 +195,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("min: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("min: invalid variant: {:?}", expr.head()?) }) } @@ -221,7 +221,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("max: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("max: invalid variant: {:?}", expr.head()?) }) } @@ -243,7 +243,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("push: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("push: invalid variant: {:?}", expr.head()?) }) } @@ -265,7 +265,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("pull: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("pull: invalid variant: {:?}", expr.head()?) }) } @@ -291,7 +291,7 @@ where state.namespace(&expr.nth(1)?)?, state.namespace(&expr.nth(2)?)?, ).draw(to)?, - _ => return Err(format!("pad: invalid variant: {:?}", expr.head()?).into()) + _ => return err!("pad: invalid variant: {:?}", expr.head()?) }) } diff --git a/src/term.rs b/src/term.rs index 11c8f6c..d45b297 100644 --- a/src/term.rs +++ b/src/term.rs @@ -182,7 +182,7 @@ impl Tui { if Exit::is(&event) { exited.store(true, Relaxed); } else if let Err(e) = state.write().apply(&TuiEvent(event)) { - panic!("{e}") + panic!("handle failed: {e}") } }) }