Crates.io | hushed_panic |
lib.rs | hushed_panic |
version | 0.1.1 |
source | src |
created_at | 2021-08-09 04:39:18.332024 |
updated_at | 2021-08-17 20:40:41.376164 |
description | Hush panic!s for a single thread. |
homepage | |
repository | https://github.com/OptimisticPeach/hushed_panic |
max_upload_size | |
id | 433492 |
size | 15,609 |
hushed_panic
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!
}
hushed_panic
is distributed under the terms of either the MIT license, or the Apache License (Version
2.0)
at the user's choice.
See the files named LICENSE-MIT and LICENSE-APACHE2 relative to the root directory of this project for more details.