Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/optimisticpeach/hushed_panic
Hush `panic!`s for a single thread.
https://github.com/optimisticpeach/hushed_panic
Last synced: about 2 months ago
JSON representation
Hush `panic!`s for a single thread.
- Host: GitHub
- URL: https://github.com/optimisticpeach/hushed_panic
- Owner: OptimisticPeach
- License: apache-2.0
- Created: 2021-08-09T04:32:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-31T02:50:37.000Z (over 3 years ago)
- Last Synced: 2024-10-13T08:45:06.371Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE-APACHE2
Awesome Lists containing this project
README
# `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:
```rs
fn my_test() {
let _x = hushed_panic::hush_this_test();
panic!(); // Won't print anything!
drop(_x);
panic!(); // Would print normally!
}
```# License
`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.