mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
get rid of unused globally-scoped notes
This commit is contained in:
parent
f52ab43752
commit
c6641dc1b9
@ -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"
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
}
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user