mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-06 08:25:41 -08:00
Run the quit cleanup on a plain kill, Ctrl+C and a closing terminal
AI Assisted
This commit is contained in:
1 parent
6a93395148
commit
8c028c1ce0
7 files changed
+458
-3
No files matched your search
@@ -0,0 +1,10 @@
|
||||
//! Lines for the app's log, its stderr, on the paths a quit takes. `eprintln!` panics when the
|
||||
//! write fails, as it does once the terminal the app was started from has closed: the quit's
|
||||
//! cleanup would end at its first line, with the app still open.
|
||||
|
||||
use std::io::Write;
|
||||
|
||||
/// Writes one line, or nothing when the log cannot be written to.
|
||||
pub fn line(text: &str) {
|
||||
let _ = writeln!(std::io::stderr(), "{text}");
|
||||
}
|
||||
Reference in new issue
Block a user