Crates.io | driveby |
lib.rs | driveby |
version | 1.0.1 |
source | src |
created_at | 2022-06-20 01:40:12.830429 |
updated_at | 2022-06-20 21:55:55.765302 |
description | Debug counter for Rust |
homepage | |
repository | https://github.com/trip-flip/driveby |
max_upload_size | |
id | 609164 |
size | 5,728 |
Ever needed a counter to see how many times a line of code is passed? Here you go.
Run without arguments to get basic debug information:
pass!(); // Stderr: [<count>][<line_number>]
You can pass a literal to have it printed:
// Stderr: [<count>][<line_number>] Special message
pass!("Special message");
// Stderr: [<count>][<line_number>] a
pass!('a');
// Stderr: [<count>][<line_number>] 5999999
pass(5999999)
You can pass a variable with the Display
trait too:
let hw = String::from("Hello world");
let num = 5;
// Stderr: [<count>][<line_number>] Hello world
pass!(hw);
// Stderr: [<count>][<line_number>] 5
pass!(num);