3 releases (stable)
1.0.1 | Jan 24, 2023 |
---|---|
1.0.0 | Mar 16, 2021 |
0.1.0 | Feb 18, 2021 |
#203 in Value formatting
16,746 downloads per month
Used in 171 crates
(16 directly)
6KB
95 lines
pretty-type-name
A shorter version of std::any::type_name
.
Example
use pretty_type_name::pretty_type_name;
mod foo {
pub mod bar {
pub struct X<T>(T);
}
pub struct Y;
}
println!(pretty_type_name::<foo::bar::X<foo::Y>>());
// prints `X<Y>`
lib.rs
:
use pretty_type_name::pretty_type_name;
mod foo {
pub mod bar {
pub struct X<T>(T);
}
pub struct Y;
}
println!("{}", pretty_type_name::<foo::bar::X<foo::Y>>());
// prints `X<Y>`