Crates.io | disp |
lib.rs | disp |
version | 0.1.1 |
source | src |
created_at | 2022-04-11 04:31:27.987081 |
updated_at | 2022-04-11 05:11:52.18709 |
description | derive Display from Debug |
homepage | https://github.com/btwiuse/disp |
repository | https://github.com/btwiuse/disp |
max_upload_size | |
id | 565388 |
size | 4,591 |
derive Display
for types that implement Debug
Example
mod hello {
use std::fmt::Display;
#[derive(Debug, disp::Display)]
pub struct Hello {}
}
fn main() {
let hello = hello::Hello {};
println!("Debug: {hello:?}, world!");
println!("Display: {hello}, world!");
}
Output:
Debug: Hello, world!
Display: Hello, world!