diff options
Diffstat (limited to 'crates/stdx')
-rw-r--r-- | crates/stdx/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs index d26be4853..b0a18d58d 100644 --- a/crates/stdx/src/lib.rs +++ b/crates/stdx/src/lib.rs | |||
@@ -178,6 +178,7 @@ where | |||
178 | start..start + len | 178 | start..start + len |
179 | } | 179 | } |
180 | 180 | ||
181 | #[repr(transparent)] | ||
181 | pub struct JodChild(pub process::Child); | 182 | pub struct JodChild(pub process::Child); |
182 | 183 | ||
183 | impl ops::Deref for JodChild { | 184 | impl ops::Deref for JodChild { |
@@ -200,6 +201,13 @@ impl Drop for JodChild { | |||
200 | } | 201 | } |
201 | } | 202 | } |
202 | 203 | ||
204 | impl JodChild { | ||
205 | pub fn into_inner(self) -> process::Child { | ||
206 | // SAFETY: repr transparent | ||
207 | unsafe { std::mem::transmute::<JodChild, process::Child>(self) } | ||
208 | } | ||
209 | } | ||
210 | |||
203 | #[cfg(test)] | 211 | #[cfg(test)] |
204 | mod tests { | 212 | mod tests { |
205 | use super::*; | 213 | use super::*; |