6 releases

0.1.5 May 21, 2024
0.1.4 May 21, 2024
0.1.3 Nov 20, 2023

#368 in Value formatting

Download history 779/week @ 2024-10-18 572/week @ 2024-10-25 707/week @ 2024-11-01 543/week @ 2024-11-08 556/week @ 2024-11-15 492/week @ 2024-11-22 350/week @ 2024-11-29 274/week @ 2024-12-06 248/week @ 2024-12-13 78/week @ 2024-12-20 52/week @ 2024-12-27 163/week @ 2025-01-03 269/week @ 2025-01-10 286/week @ 2025-01-17 350/week @ 2025-01-24 233/week @ 2025-01-31

1,178 downloads per month
Used in 2 crates

Apache-2.0

8KB
178 lines

hide (from debug)

crates.io docs.rs

Hide secrets from logs.

Seriously?

You might ask: "A crate, for a simple feature like this?". Yes, maybe this type will be shared between crates. Compared to multiple different types in different crates.

Add to your project

hide = "0.1

Usage

use hide::Hide;

#[derive(Debug)]
pub struct MyStruct {
    username: String,
    password: Hide<String>,
}

fn example1() {
    let data = MyStruct {
        username: "user".to_string(),
        password: "password".to_string().into(),
    };
    println!("{data:#?}");
}

Will give you:

MyStruct {
    username: "user",
    password: ***,
}

lib.rs:

Hide credentials from debug output

Example

use hide::Hide;

#[derive(Debug)]
pub struct MyStruct {
    username: String,
    password: Hide<String>,
}

fn example1() {
    let data = MyStruct {
        username: "user".to_string(),
        password: "password".to_string().into(),
    };
    println!("{data:#?}");
}

Dependencies

~0–330KB