3 releases (stable)

1.0.1 Jan 24, 2023
1.0.0 Mar 16, 2021
0.1.0 Feb 18, 2021

#158 in Value formatting

Download history 1713/week @ 2023-12-10 2092/week @ 2023-12-17 2004/week @ 2023-12-24 1608/week @ 2023-12-31 2014/week @ 2024-01-07 2395/week @ 2024-01-14 2305/week @ 2024-01-21 2014/week @ 2024-01-28 2144/week @ 2024-02-04 2693/week @ 2024-02-11 3719/week @ 2024-02-18 3065/week @ 2024-02-25 3228/week @ 2024-03-03 2797/week @ 2024-03-10 3144/week @ 2024-03-17 2530/week @ 2024-03-24

12,106 downloads per month
Used in 87 crates (9 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