3 releases (stable)
1.0.1 | Jan 24, 2023 |
---|---|
1.0.0 | Mar 16, 2021 |
0.1.0 | Feb 18, 2021 |
#152 in Value formatting
12,221 downloads per month
Used in 87 crates
(9 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>`