aboutsummaryrefslogtreecommitdiff
path: root/crates/stdx
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-07 18:07:01 +0000
committerGitHub <[email protected]>2021-01-07 18:07:01 +0000
commit4ddf075673c4a8e3b5b0be5a2f085cdefe3993ef (patch)
treeddf9095806ebde252404da0c85946f4778e6aae9 /crates/stdx
parentc29d35362389395ea2b40fc863c70c8597137e52 (diff)
parent2b2d699b35d69375def80fe51c6a8c3bfbe53828 (diff)
Merge #7193
7193: Show progress for fetching workspace (cargo-metadata and loadOutDirsFromCheck) r=matklad a=edwin0cheng ![Peek 2021-01-07 21-57](https://user-images.githubusercontent.com/11014119/103902132-0db4c780-5135-11eb-94d3-32429445be87.gif) Fixes #7188 Fixes #3300 Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/stdx')
-rw-r--r--crates/stdx/src/lib.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index 374ed5910..5332edb09 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -1,5 +1,5 @@
1//! Missing batteries for standard libraries. 1//! Missing batteries for standard libraries.
2use std::time::Instant; 2use std::{ops, process, time::Instant};
3 3
4mod macros; 4mod macros;
5pub mod panic_context; 5pub mod panic_context;
@@ -147,6 +147,27 @@ where
147 left 147 left
148} 148}
149 149
150pub struct JodChild(pub process::Child);
151
152impl ops::Deref for JodChild {
153 type Target = process::Child;
154 fn deref(&self) -> &process::Child {
155 &self.0
156 }
157}
158
159impl ops::DerefMut for JodChild {
160 fn deref_mut(&mut self) -> &mut process::Child {
161 &mut self.0
162 }
163}
164
165impl Drop for JodChild {
166 fn drop(&mut self) {
167 let _ = self.0.kill();
168 }
169}
170
150#[cfg(test)] 171#[cfg(test)]
151mod tests { 172mod tests {
152 use super::*; 173 use super::*;