mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
Explain tests::init function
This commit is contained in:
@@ -329,8 +329,8 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
static INIT: std::sync::Once = std::sync::Once::new();
|
||||
|
||||
/// Call this from every test to initialize eyre only once across all tests.
|
||||
pub fn init() {
|
||||
static INIT: std::sync::Once = std::sync::Once::new();
|
||||
INIT.call_once(|| color_eyre::install().unwrap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user