use err! macro

This commit is contained in:
facile pop culture reference 2026-09-19 10:11:27 +03:00
parent f66fc363b7
commit 79f9cfcbf9
3 changed files with 9 additions and 9 deletions

View file

@ -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()?)
})
}

View file

@ -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}")
}
})
}