mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-29 03:08:31 +00:00
move infallible handling into error
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
4cc92dd175
commit
4600c7f32d
3 changed files with 19 additions and 18 deletions
|
@ -196,7 +196,11 @@ impl UnwindSafe for Error {}
|
|||
impl RefUnwindSafe for Error {}
|
||||
|
||||
impl From<Infallible> for Error {
|
||||
fn from(i: Infallible) -> Self { match i {} }
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn from(_i: Infallible) -> Self {
|
||||
panic!("infallible error should never exist");
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Error {
|
||||
|
@ -273,6 +277,12 @@ pub fn inspect_debug_log<E: fmt::Debug>(error: &E) {
|
|||
debug_error!("{error:?}");
|
||||
}
|
||||
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
pub fn infallible(_e: &Infallible) {
|
||||
panic!("infallible error should never exist");
|
||||
}
|
||||
|
||||
impl axum::response::IntoResponse for Error {
|
||||
fn into_response(self) -> axum::response::Response {
|
||||
let response: UiaaResponse = self.into();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue