Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

Commit

Permalink
Fix clippy warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Apr 17, 2019
1 parent 4dac85b commit a47691f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::fs::File;
use std::io::prelude::*;
use std::panic;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};

pub fn read_testdata_to_string(filename: &str) -> String {
let mut datapath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
Expand All @@ -15,8 +16,12 @@ pub fn read_testdata_to_string(filename: &str) -> String {
contents
}

static LOGGER_INITIALIZED: AtomicBool = AtomicBool::new(false);

fn setup() {
env_logger::try_init().is_ok();
if !LOGGER_INITIALIZED.compare_and_swap(false, true, Ordering::Relaxed) {
env_logger::try_init().expect("Error initializing logger");
}
}

pub fn run_test<T>(test: T)
Expand Down

0 comments on commit a47691f

Please sign in to comment.