Explain tests::init function

This commit is contained in:
Oli Scherer 2022-07-07 08:15:21 +00:00
parent a1e0d0df79
commit bc07c19961

View file

@ -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());
}