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
13 eprintln!("{}", Tail);
14
15 WriteToFile::Fn(&Tail);
16 }
17
18 State.LastKey.clear();
19
20 State.Count = 0;
21 }
22}