aboutsummaryrefslogtreecommitdiff
path: root/helix-loader/src
diff options
context:
space:
mode:
authorFrojdholm2022-06-02 07:54:11 +0000
committerGitHub2022-06-02 07:54:11 +0000
commitf7c27b604f32cbd10ec42f70d3fec3ff79cacc63 (patch)
treefea1ea37df278bf1a60502c31456e38b848400b7 /helix-loader/src
parent378f438fb033561831cd6e0f94845feaf82bbbcb (diff)
Ignore SendErrors when handling grammars (#2641)
When handling grammars, fetching and building is done in a thread pool. Results are communicated over channels and the receiving channel is closed on first error. This causes subsequent sends to fail causing a mess in stderr. This ignores all SendErrors causing only the first error to be printed.
Diffstat (limited to 'helix-loader/src')
-rw-r--r--helix-loader/src/grammar.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs
index d2769d81..7aa9bc83 100644
--- a/helix-loader/src/grammar.rs
+++ b/helix-loader/src/grammar.rs
@@ -133,7 +133,9 @@ where
let tx = tx.clone();
pool.execute(move || {
- tx.send(job(grammar)).unwrap();
+ // Ignore any SendErrors, if any job in another thread has encountered an
+ // error the Receiver will be closed causing this send to fail.
+ let _ = tx.send(job(grammar));
});
}