3 releases (stable)

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

#133 in Value formatting

Download history 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 3391/week @ 2024-09-28 3094/week @ 2024-10-05 3074/week @ 2024-10-12 3243/week @ 2024-10-19 3212/week @ 2024-10-26 3832/week @ 2024-11-02

13,735 downloads per month
Used in 176 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