Skip to main content

Mountain/IPC/DevLog/
FlushDedup.rs

1#![allow(non_snake_case)]
2
3//! Flush the consecutive-duplicate buffer - emits a `(xN)` tail
4//! line if the pending count is greater than 1, then clears.
5
6use crate::IPC::DevLog::{DedupState, WriteToFile};
7
8pub fn Fn() {
9	if let Ok(mut State) = DedupState::DEDUP.lock() {
10		if State.Count > 1 {
11			let Tail = format!("  (x{})", State.Count);
12			eprintln!("{}", Tail);
13			WriteToFile::Fn(&Tail);
14		}
15		State.LastKey.clear();
16		State.Count = 0;
17	}
18}