]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/unix/process/process_unix.rs
Remove combine function
[rust.git] / src / libstd / sys / unix / process / process_unix.rs
index de35fe0521d03a8a3cefc8597732868048eca5b7..a8499070e15081acb3d016ef5a95b2d7456aad9a 100644 (file)
@@ -84,12 +84,12 @@ pub fn spawn(
                 Ok(0) => return Ok((p, ours)),
                 Ok(8) => {
                     let (errno, footer) = bytes.split_at(4);
-                    assert!(
-                        combine(CLOEXEC_MSG_FOOTER) == combine(footer.try_into().unwrap()),
+                    assert_eq!(
+                        CLOEXEC_MSG_FOOTER, footer,
                         "Validation on the CLOEXEC pipe failed: {:?}",
                         bytes
                     );
-                    let errno = combine(errno.try_into().unwrap());
+                    let errno = i32::from_be_bytes(errno.try_into().unwrap());
                     assert!(p.wait().is_ok(), "wait() should either return Ok or panic");
                     return Err(Error::from_raw_os_error(errno));
                 }
@@ -105,10 +105,6 @@ pub fn spawn(
                 }
             }
         }
-
-        fn combine(arr: [u8; 4]) -> i32 {
-            i32::from_be_bytes(arr)
-        }
     }
 
     pub fn exec(&mut self, default: Stdio) -> io::Error {