6 releases

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

#351 in Value formatting

Download history 472/week @ 2024-07-23 321/week @ 2024-07-30 410/week @ 2024-08-06 138/week @ 2024-08-13 269/week @ 2024-08-20 349/week @ 2024-08-27 361/week @ 2024-09-03 333/week @ 2024-09-10 315/week @ 2024-09-17 466/week @ 2024-09-24 252/week @ 2024-10-01 395/week @ 2024-10-08 416/week @ 2024-10-15 707/week @ 2024-10-22 577/week @ 2024-10-29 623/week @ 2024-11-05

2,403 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–325KB