#pretty #type #types #name #mod #version

pretty-type-name

a shorter version of std::any::type_name

2 releases (1 stable)

1.0.0 Mar 16, 2021
0.1.0 Feb 18, 2021
Download history 529/week @ 2022-04-25 617/week @ 2022-05-02 911/week @ 2022-05-09 777/week @ 2022-05-16 926/week @ 2022-05-23 946/week @ 2022-05-30 568/week @ 2022-06-06 599/week @ 2022-06-13 860/week @ 2022-06-20 515/week @ 2022-06-27 377/week @ 2022-07-04 463/week @ 2022-07-11 484/week @ 2022-07-18 560/week @ 2022-07-25 1167/week @ 2022-08-01 861/week @ 2022-08-08

3,133 downloads per month
Used in 14 crates (2 directly)

MIT license

5KB
82 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>>());
# assert_eq!(pretty_type_name::<foo::bar::X<foo::Y>>(), "X<Y>".to_string());
// prints `X<Y>`

No runtime deps