get rid of unused globally-scoped notes

This commit is contained in:
Dustin Carlino 2019-09-14 19:19:35 -07:00
parent f52ab43752
commit c6641dc1b9
4 changed files with 1 additions and 28 deletions

View File

@ -6,7 +6,6 @@ edition = "2018"
[dependencies]
bincode = "1.1.2"
lazy_static = "1.3.0"
num_cpus = "1.10.0"
rand = "0.7.0"
rand_xorshift = "0.2.0"

View File

@ -3,7 +3,6 @@ mod collections;
mod error;
mod io;
mod logs;
mod notes;
mod random;
mod time;
@ -19,7 +18,6 @@ pub use crate::io::{
FileWithProgress,
};
pub use crate::logs::Warn;
pub use crate::notes::note;
pub use crate::random::{fork_rng, WeightedUsizeChoice};
pub use crate::time::{
elapsed_seconds, prettyprint_usize, MeasureMemory, Profiler, Timer, TimerSink,

View File

@ -1,23 +0,0 @@
use lazy_static::lazy_static;
use std::sync::Mutex;
// TODO Maybe just use Timer.
lazy_static! {
static ref NOTES: Mutex<Vec<String>> = Mutex::new(Vec::new());
}
pub fn note(msg: String) {
NOTES.lock().unwrap().push(msg);
}
pub fn dump_notes() {
let mut notes = NOTES.lock().unwrap();
// TODO log or println?
for msg in notes.iter() {
println!("{}", msg);
}
notes.clear();
}

View File

@ -1,4 +1,4 @@
use crate::{notes, PROGRESS_FREQUENCY_SECONDS};
use crate::PROGRESS_FREQUENCY_SECONDS;
use std::collections::HashMap;
use std::fs::File;
use std::io::{stdout, BufReader, Error, Read, Write};
@ -386,7 +386,6 @@ impl<'a> std::ops::Drop for Timer<'a> {
}
self.println(String::new());
}
notes::dump_notes();
if !self.warnings.is_empty() {
self.println(format!("{} warnings:", self.warnings.len()));