mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-05-24 01:36:04 +02:00
22 lines
473 B
Rust
22 lines
473 B
Rust
use std::{error, fmt, result};
|
|
|
|
pub type Result<T> = result::Result<T, Error>;
|
|
|
|
pub type Error = Box<dyn error::Error>;
|
|
|
|
pub type Exit = result::Result<(), Display<Error>>;
|
|
|
|
pub struct Display<T: fmt::Display>(T);
|
|
|
|
impl<T: fmt::Display> fmt::Debug for Display<T> {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
write!(f, "{}", self.0)
|
|
}
|
|
}
|
|
|
|
impl<T: fmt::Display> From<T> for Display<T> {
|
|
fn from(t: T) -> Display<T> {
|
|
Display(t)
|
|
}
|
|
}
|