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

Download history 3213/week @ 2024-06-15 3194/week @ 2024-06-22 2279/week @ 2024-06-29 3798/week @ 2024-07-06 3460/week @ 2024-07-13 4108/week @ 2024-07-20 4269/week @ 2024-07-27 3230/week @ 2024-08-03 5136/week @ 2024-08-10 3942/week @ 2024-08-17 4203/week @ 2024-08-24 4481/week @ 2024-08-31 4249/week @ 2024-09-07 3946/week @ 2024-09-14 4924/week @ 2024-09-21 2871/week @ 2024-09-28

16,746 downloads per month
Used in 171 crates (16 directly)

MIT license

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>`

No runtime deps