Fix minor warnings and debug log
This commit is contained in:
14
src/debug.rs
14
src/debug.rs
@@ -1,12 +1,12 @@
|
||||
use std::num::NonZeroUsize;
|
||||
// use std::num::NonZeroUsize;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DebugLog {
|
||||
enabled: bool,
|
||||
current: String,
|
||||
history: Vec<String>,
|
||||
max_history: Option<NonZeroUsize>,
|
||||
pos: usize,
|
||||
// max_history: Option<NonZeroUsize>,
|
||||
// pos: usize,
|
||||
}
|
||||
|
||||
impl DebugLog {
|
||||
@@ -15,8 +15,8 @@ impl DebugLog {
|
||||
enabled: false,
|
||||
current: String::new(),
|
||||
history: vec![],
|
||||
max_history: None,
|
||||
pos: 0,
|
||||
// max_history: None,
|
||||
// pos: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ impl DebugLog {
|
||||
pub fn enable(&mut self) {
|
||||
self.enabled = true;
|
||||
}
|
||||
|
||||
pub fn enabled(&self) -> bool {
|
||||
self.enabled
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Write for DebugLog {
|
||||
|
||||
Reference in New Issue
Block a user