1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

refactor/polish ~ fix cargo clippy complaints (redundant_static_lifetimes)

This commit is contained in:
Roy Ivy III 2020-02-06 22:40:45 -06:00
parent c4a69f2f4e
commit 75f05df119
4 changed files with 10 additions and 11 deletions

View file

@ -3,7 +3,7 @@ use std::fs::File;
use std::io::Write;
use std::path::Path;
static TEMPLATE: &'static str = "\
static TEMPLATE: &str = "\
extern crate uu_@UTIL_CRATE@;
extern crate uucore;

View file

@ -137,7 +137,7 @@ fn test_generator() {
}
const MAX_WIDTH: usize = 102;
const PREAMBLE: &'static str = r##"/*
const PREAMBLE: &str = r##"/*
* This file is part of the uutils coreutils package.
*
* (c) kwantam <kwantam@gmail.com>

View file

@ -126,11 +126,11 @@ impl Wheel {
/// The increments of a wheel of circumference 210
/// (i.e., a wheel that skips all multiples of 2, 3, 5, 7)
const WHEEL_INCS: &'static [u64] = &[
const WHEEL_INCS: &[u64] = &[
2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6,
2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 10, 2, 10,
];
const INIT_PRIMES: &'static [u64] = &[2, 3, 5, 7];
const INIT_PRIMES: &[u64] = &[2, 3, 5, 7];
/// A min-heap of "infinite lists" of prime multiples, where a list is
/// represented as (head, increment).

View file

@ -18,18 +18,17 @@ use std::thread::sleep;
use std::time::Duration;
#[cfg(windows)]
static PROGNAME: &'static str = "uutils.exe";
static PROGNAME: &str = "uutils.exe";
#[cfg(not(windows))]
static PROGNAME: &'static str = "uutils";
static PROGNAME: &str = "uutils";
static TESTS_DIR: &'static str = "tests";
static FIXTURES_DIR: &'static str = "fixtures";
static TESTS_DIR: &str = "tests";
static FIXTURES_DIR: &str = "fixtures";
static ALREADY_RUN: &'static str =
" you have already run this UCommand, if you want to run \
static ALREADY_RUN: &str = " you have already run this UCommand, if you want to run \
another command in the same test, use TestScenario::new instead of \
testing();";
static MULTIPLE_STDIN_MEANINGLESS: &'static str = "Ucommand is designed around a typical use case of: provide args and input stream -> spawn process -> block until completion -> return output streams. For verifying that a particular section of the input stream is what causes a particular behavior, use the Command type directly.";
static MULTIPLE_STDIN_MEANINGLESS: &str = "Ucommand is designed around a typical use case of: provide args and input stream -> spawn process -> block until completion -> return output streams. For verifying that a particular section of the input stream is what causes a particular behavior, use the Command type directly.";
/// Test if the program is running under WSL
// ref: <https://github.com/microsoft/WSL/issues/4555> @@ <https://archive.is/dP0bz>