mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-10-08 12:16:43 +02:00
use err! macro
This commit is contained in:
parent
f66fc363b7
commit
79f9cfcbf9
3 changed files with 9 additions and 9 deletions
2
dizzle
2
dizzle
|
|
@ -1 +1 @@
|
||||||
Subproject commit 11d47d8647093c396f3067035eb66a1229d1a373
|
Subproject commit 2ffea53c34c7b12d5149293027d58a114fc4ef7b
|
||||||
|
|
@ -143,7 +143,7 @@ where
|
||||||
Some("full/x") | Some("full/w") => Full::W(thunk).draw(to)?,
|
Some("full/x") | Some("full/w") => Full::W(thunk).draw(to)?,
|
||||||
Some("full/y") | Some("full/h") => Full::H(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)?,
|
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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).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(1)?)?,
|
||||||
state.namespace(&expr.nth(2)?)?,
|
state.namespace(&expr.nth(2)?)?,
|
||||||
).draw(to)?,
|
).draw(to)?,
|
||||||
_ => return Err(format!("pad: invalid variant: {:?}", expr.head()?).into())
|
_ => return err!("pad: invalid variant: {:?}", expr.head()?)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ impl Tui {
|
||||||
if Exit::is(&event) {
|
if Exit::is(&event) {
|
||||||
exited.store(true, Relaxed);
|
exited.store(true, Relaxed);
|
||||||
} else if let Err(e) = state.write().apply(&TuiEvent(event)) {
|
} else if let Err(e) = state.write().apply(&TuiEvent(event)) {
|
||||||
panic!("{e}")
|
panic!("handle failed: {e}")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue