aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cargo_watch
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-27 23:33:06 +0000
committerGitHub <[email protected]>2020-01-27 23:33:06 +0000
commit912776fd9547d1d28b4cba7e4a41e5391fc12c21 (patch)
tree3b4137a41a8e2ad8a7baf20be9ec55c728a8b42f /crates/ra_cargo_watch
parent5dd8f8e26f2a62f5e7e4da50dcdfde344f6d31b9 (diff)
parentc34571c19e727654139a27c5b9d656485fb516f9 (diff)
Merge #2916
2916: Buffer reads from cargo check's stdout r=matklad a=lnicola `Stdio::piped()` is unbuffered, which caused RA to read the output of `cargo check` one byte at a time (out of 114KB in my test). This isn't obviously faster on my system, but making fewer syscalls sounds like a good idea. Co-authored-by: LaurenČ›iu Nicola <[email protected]>
Diffstat (limited to 'crates/ra_cargo_watch')
-rw-r--r--crates/ra_cargo_watch/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs
index bbe634603..e7b700c10 100644
--- a/crates/ra_cargo_watch/src/lib.rs
+++ b/crates/ra_cargo_watch/src/lib.rs
@@ -9,6 +9,7 @@ use lsp_types::{
9}; 9};
10use std::{ 10use std::{
11 collections::HashMap, 11 collections::HashMap,
12 io::BufReader,
12 path::PathBuf, 13 path::PathBuf,
13 process::{Command, Stdio}, 14 process::{Command, Stdio},
14 sync::Arc, 15 sync::Arc,
@@ -347,7 +348,9 @@ impl WatchThread {
347 // which will break out of the loop, and continue the shutdown 348 // which will break out of the loop, and continue the shutdown
348 let _ = message_send.send(CheckEvent::Begin); 349 let _ = message_send.send(CheckEvent::Begin);
349 350
350 for message in cargo_metadata::parse_messages(command.stdout.take().unwrap()) { 351 for message in
352 cargo_metadata::parse_messages(BufReader::new(command.stdout.take().unwrap()))
353 {
351 let message = match message { 354 let message = match message {
352 Ok(message) => message, 355 Ok(message) => message,
353 Err(err) => { 356 Err(err) => {