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§
- Hush
Guard - When this
struct
is dropped, the current thread’s panic is unhushed.
Functions§
- hush_
panic - Hushes panics for this thread.
- hush_
this_ test - Returns a guard which will call
unhush_panic
after it is dropped. - unhush_
panic - Un-hushes panics on this thread.