Skip to content

Commit d4eff70

Browse files
committed
remove sketchy intos
1 parent d420b82 commit d4eff70

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

library/std/src/os/fd/owned.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#![stable(feature = "io_safety", since = "1.63.0")]
44
#![deny(unsafe_op_in_unsafe_fn)]
5-
#![cfg_attr(not(bootstrap), allow(self_type_conversion))]
65
use super::raw::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
76
use crate::marker::PhantomData;
87
use crate::mem::ManuallyDrop;
@@ -329,7 +328,7 @@ impl From<crate::net::TcpStream> for OwnedFd {
329328
/// Takes ownership of a [`TcpStream`](crate::net::TcpStream)'s socket file descriptor.
330329
#[inline]
331330
fn from(tcp_stream: crate::net::TcpStream) -> OwnedFd {
332-
tcp_stream.into_inner().into_socket().into_inner().into_inner().into()
331+
tcp_stream.into_inner().into_socket().into_inner().into_inner()
333332
}
334333
}
335334

@@ -356,7 +355,7 @@ impl From<crate::net::TcpListener> for OwnedFd {
356355
/// Takes ownership of a [`TcpListener`](crate::net::TcpListener)'s socket file descriptor.
357356
#[inline]
358357
fn from(tcp_listener: crate::net::TcpListener) -> OwnedFd {
359-
tcp_listener.into_inner().into_socket().into_inner().into_inner().into()
358+
tcp_listener.into_inner().into_socket().into_inner().into_inner()
360359
}
361360
}
362361

@@ -383,7 +382,7 @@ impl From<crate::net::UdpSocket> for OwnedFd {
383382
/// Takes ownership of a [`UdpSocket`](crate::net::UdpSocket)'s file descriptor.
384383
#[inline]
385384
fn from(udp_socket: crate::net::UdpSocket) -> OwnedFd {
386-
udp_socket.into_inner().into_socket().into_inner().into_inner().into()
385+
udp_socket.into_inner().into_socket().into_inner().into_inner()
387386
}
388387
}
389388

library/std/src/sys/pal/unix/process/process_unix.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ impl Command {
285285
// have the drop glue anyway because this code never returns (the
286286
// child will either exec() or invoke libc::exit)
287287
#[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
288-
#[cfg_attr(not(bootstrap), allow(self_type_conversion))]
289288
unsafe fn do_exec(
290289
&mut self,
291290
stdio: ChildPipes,
@@ -329,7 +328,7 @@ impl Command {
329328
// An alternative would be to require CAP_SETGID (in
330329
// addition to CAP_SETUID) for setting the UID.
331330
if e.raw_os_error() != Some(libc::EPERM) {
332-
return Err(e.into());
331+
return Err(e);
333332
}
334333
}
335334
}

library/std/src/sys_common/process.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ impl fmt::Debug for CommandEnv {
2525

2626
impl CommandEnv {
2727
// Capture the current environment with these changes applied
28-
#[cfg_attr(not(bootstrap), allow(self_type_conversion))]
2928
pub fn capture(&self) -> BTreeMap<EnvKey, OsString> {
3029
let mut result = BTreeMap::<EnvKey, OsString>::new();
3130
if !self.clear {
3231
for (k, v) in env::vars_os() {
33-
result.insert(k.into(), v);
32+
result.insert(k, v);
3433
}
3534
}
3635
for (k, maybe_v) in &self.vars {

0 commit comments

Comments
 (0)