From 0d8c33f6f14c2a2e0ce03d82b313006e84b7a9c2 Mon Sep 17 00:00:00 2001 From: Jake Wharton <jw@squareup.com> Date: Wed, 2 Apr 2025 23:03:55 -0400 Subject: [PATCH] Remove creation of duplicate AnonPipe The File is unwrapped to a Handle into an AnonPipe, and then that AnonPipe was unwrapped to a Handle into another AnonPipe. The second operation is entirely redundant. --- library/std/src/sys/pal/windows/pipe.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/std/src/sys/pal/windows/pipe.rs b/library/std/src/sys/pal/windows/pipe.rs index c785246492268..7fd6233961951 100644 --- a/library/std/src/sys/pal/windows/pipe.rs +++ b/library/std/src/sys/pal/windows/pipe.rs @@ -143,7 +143,6 @@ pub fn anon_pipe(ours_readable: bool, their_handle_inheritable: bool) -> io::Res }; opts.security_attributes(&mut sa); let theirs = File::open(Path::new(&name), &opts)?; - let theirs = AnonPipe { inner: theirs.into_inner() }; Ok(Pipes { ours: AnonPipe { inner: ours },