#macro-use #exists

nightly dump

A simple macro that takes one or more variables and prints the name, type, and value of each variable. The output is also prefixed with [source_file:line_no].

2 releases

Uses old Rust 2015

0.1.1 Feb 18, 2016
0.1.0 Feb 18, 2016

#5 in #exists

Download history 8/week @ 2024-12-04 30/week @ 2024-12-11 10/week @ 2024-12-18 7/week @ 2025-01-01 12/week @ 2025-01-08 28/week @ 2025-01-15 14/week @ 2025-01-22 140/week @ 2025-01-29 43/week @ 2025-02-05 67/week @ 2025-02-12 12/week @ 2025-02-19 25/week @ 2025-02-26 10/week @ 2025-03-05 34/week @ 2025-03-12

81 downloads per month

MIT/Apache

6KB

dump

dump provides a macro dump! that takes one or more variables and prints the name, type, and value of each variable. The output is also prefixed with [source_file:line_no].

This is designed to be a little more ergonomic than println!("a={:?} b={:?}", a, b) and also has the benefit of printing the type.

Usage

Add this to your Cargo.toml:

[dependencies]
dump = "0.1"

and this to your crate root:

#[macro_use]
extern crate dump;

Example

#[macro_use]
extern crate dump;

fn main() {
	let s = "hi";
	let n = 3;
	dump!(s, n);
}

Outputs:

[src/main.rs:7] s: &'static str = "hi"; n: i32 = 3;

No runtime deps