From af9a36dfe4ed2f14b70842fecefc74f1ff332640 Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Wed, 23 Jun 2021 11:34:50 +0100 Subject: [PATCH 1/2] remove useless conversions --- src/cargo/core/compiler/output_depinfo.rs | 2 +- src/cargo/core/shell.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/core/compiler/output_depinfo.rs b/src/cargo/core/compiler/output_depinfo.rs index 01136017dec..66596bb1880 100644 --- a/src/cargo/core/compiler/output_depinfo.rs +++ b/src/cargo/core/compiler/output_depinfo.rs @@ -84,7 +84,7 @@ fn add_deps_for_unit( // The paths we have saved from the unit are of arbitrary relativeness and may be // relative to the crate root of the dependency. let path = unit.pkg.root().join(path); - deps.insert(path.into()); + deps.insert(path); } } } diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 7a9b6824fd6..ab07d72b7a2 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -457,7 +457,7 @@ mod imp { let mut winsize: libc::winsize = mem::zeroed(); // The .into() here is needed for FreeBSD which defines TIOCGWINSZ // as c_uint but ioctl wants c_ulong. - if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ.into(), &mut winsize) < 0 { + if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ, &mut winsize) < 0 { return TtyWidth::NoTty; } if winsize.ws_col > 0 { From a6d3fb0c611fed62be0fcc0bda959e4fb7981541 Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Mon, 12 Jul 2021 20:59:35 +0100 Subject: [PATCH 2/2] revert platform-specific conversion --- src/cargo/core/shell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index ab07d72b7a2..7a9b6824fd6 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -457,7 +457,7 @@ mod imp { let mut winsize: libc::winsize = mem::zeroed(); // The .into() here is needed for FreeBSD which defines TIOCGWINSZ // as c_uint but ioctl wants c_ulong. - if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ, &mut winsize) < 0 { + if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ.into(), &mut winsize) < 0 { return TtyWidth::NoTty; } if winsize.ws_col > 0 {