#variables #quick #returning #printing #macro

nightly ttype

ttype - A quick macro for printing or returning the type of a variable

2 releases

0.1.1 May 21, 2020
0.1.0 May 18, 2020

#2265 in Rust patterns

30 downloads per month

Custom license

3KB

ttype

A quick crate that creates a macro to print or return the type of a variable.

Right now this depends on the unstable fetaures type_name_of_val() so it will require both Rust Nightly and the #![feature(type_name_of_val)] attribute for your debugging needs.

Example:

#![feature(type_name_of_val)]
#[macro_use]
use ttype::ptype;

fn main() {
    let x = "Hello, world";

    //prints &str
    ptype!(&x);
}

No runtime deps