3 releases (stable)

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

#81 in Value formatting

Download history 4072/week @ 2024-09-25 3235/week @ 2024-10-02 2919/week @ 2024-10-09 3282/week @ 2024-10-16 3341/week @ 2024-10-23 3841/week @ 2024-10-30 3407/week @ 2024-11-06 2799/week @ 2024-11-13 3378/week @ 2024-11-20 3936/week @ 2024-11-27 3057/week @ 2024-12-04 3186/week @ 2024-12-11 2939/week @ 2024-12-18 1357/week @ 2024-12-25 2297/week @ 2025-01-01 3020/week @ 2025-01-08

10,091 downloads per month
Used in 150 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