Crate hushed_panic[][src]

Expand description

A crate for hushing panics for a specific thread.

This is especially useful for when you want to hush tests which are intended to panic, but do not want to see the long output.

Usage in a test:

fn my_test() {
    let _x = hushed_panic::hush_this_test();
    panic!(); // Won't print anything!
    drop(_x);
    panic!(); // Would print normally!
}

Structs

When this struct is dropped, the current thread’s panic is unhushed.

Functions

Hushes panics for this thread.

Returns a guard which will call unhush_panic after it is dropped.

Un-hushes panics on this thread.