Skip to content

Commit 40e53e4

Browse files
committed
clippy: Fix lints in other platforms
1 parent ba5b7ad commit 40e53e4

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn main() {
6666
\n\
6767
#[allow(clippy::too_many_lines)]
6868
#[allow(clippy::unreadable_literal)]
69-
fn util_map<T: uucore::Args>() -> UtilityMap<T> {\n"
69+
fn util_map<T: Args>() -> UtilityMap<T> {\n"
7070
.as_bytes(),
7171
)
7272
.unwrap();

src/bin/coreutils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::cmp;
99
use std::ffi::OsString;
1010
use std::io::{self, Write};
1111
use std::process;
12+
use uucore::Args;
1213

1314
const VERSION: &str = env!("CARGO_PKG_VERSION");
1415

src/uucore/src/lib/features/fsext.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,7 @@ impl FsUsage {
586586
blocks: statvfs.f_blocks,
587587
bfree: statvfs.f_bfree,
588588
bavail: statvfs.f_bavail.try_into().unwrap(),
589-
bavail_top_bit_set: ((std::convert::TryInto::<u64>::try_into(statvfs.f_bavail)
590-
.unwrap())
589+
bavail_top_bit_set: ((TryInto::<u64>::try_into(statvfs.f_bavail).unwrap())
591590
& (1u64.rotate_right(1)))
592591
!= 0,
593592
files: statvfs.f_files,
@@ -599,8 +598,7 @@ impl FsUsage {
599598
blocks: statvfs.f_blocks,
600599
bfree: statvfs.f_bfree,
601600
bavail: statvfs.f_bavail.try_into().unwrap(),
602-
bavail_top_bit_set: ((std::convert::TryInto::<u64>::try_into(statvfs.f_bavail)
603-
.unwrap())
601+
bavail_top_bit_set: ((TryInto::<u64>::try_into(statvfs.f_bavail).unwrap())
604602
& (1u64.rotate_right(1)))
605603
!= 0,
606604
files: statvfs.f_files,

tests/by-util/test_dd.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ use std::path::PathBuf;
2525
not(target_os = "freebsd"),
2626
feature = "printf"
2727
))]
28-
use std::process::{Command, Stdio};
28+
use std::process::Command;
29+
use std::process::Stdio;
2930
#[cfg(not(windows))]
3031
use std::thread::sleep;
3132
#[cfg(not(windows))]
@@ -674,7 +675,6 @@ fn test_skip_beyond_file() {
674675
fn test_skip_beyond_file_seekable_stdin() {
675676
// When stdin is a seekable file, dd should use seek to skip bytes.
676677
// This tests that skipping beyond the file size issues a warning.
677-
use std::process::Stdio;
678678

679679
// Test cases: (bs, skip) pairs that skip beyond a 4-byte file
680680
let test_cases = [
@@ -1760,8 +1760,6 @@ fn test_iflag_directory_fails_when_file_is_piped_via_std_in() {
17601760

17611761
#[test]
17621762
fn test_stdin_stdout_not_rewound_even_when_connected_to_seekable_file() {
1763-
use std::process::Stdio;
1764-
17651763
let ts = TestScenario::new(util_name!());
17661764
let at = &ts.fixtures;
17671765

@@ -1821,8 +1819,6 @@ fn test_wrong_number_err_msg() {
18211819
#[test]
18221820
#[cfg(unix)]
18231821
fn test_no_dropped_writes() {
1824-
use std::process::Stdio;
1825-
18261822
const BLK_SIZE: usize = 0x4000;
18271823
const COUNT: usize = 1000;
18281824
const NUM_BYTES: usize = BLK_SIZE * COUNT;

0 commit comments

Comments
 (0)