From 10a2486163a985dd1db321d770ac3e670fae2c47 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 6 Jul 2021 09:27:31 -0500 Subject: [PATCH] perf(diff): Don't lock on every line --- src/file.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.rs b/src/file.rs index 5645522..4f081e6 100644 --- a/src/file.rs +++ b/src/file.rs @@ -235,8 +235,10 @@ impl FileChecker for DiffTypos { "fixed", 0, ); + let stdout = std::io::stdout(); + let mut handle = stdout.lock(); for line in diff { - write!(std::io::stdout(), "{}", line)?; + write!(handle, "{}", line)?; } }