mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 13:07:46 +00:00
Remove unused mutation from variables.
This commit is contained in:
parent
6b927c2ec3
commit
3270040778
5 changed files with 7 additions and 7 deletions
|
@ -68,8 +68,8 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
},
|
},
|
||||||
None => 76
|
None => 76
|
||||||
};
|
};
|
||||||
let mut stdin_buf;
|
let stdin_buf;
|
||||||
let mut file_buf;
|
let file_buf;
|
||||||
let mut input = if matches.free.is_empty() || &matches.free[0][..] == "-" {
|
let mut input = if matches.free.is_empty() || &matches.free[0][..] == "-" {
|
||||||
stdin_buf = stdin();
|
stdin_buf = stdin();
|
||||||
BufReader::new(Box::new(stdin_buf) as Box<Read+'static>)
|
BufReader::new(Box::new(stdin_buf) as Box<Read+'static>)
|
||||||
|
|
|
@ -127,7 +127,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open(path: String) -> BufReader<Box<Read+'static>> {
|
fn open(path: String) -> BufReader<Box<Read+'static>> {
|
||||||
let mut file_buf;
|
let file_buf;
|
||||||
if path == "-" {
|
if path == "-" {
|
||||||
BufReader::new(Box::new(stdin()) as Box<Read>)
|
BufReader::new(Box::new(stdin()) as Box<Read>)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -169,8 +169,8 @@ fn hashsum<'a>(algoname: &str, mut digest: Box<Digest+'a>, files: Vec<String>, b
|
||||||
};
|
};
|
||||||
for filename in files.iter() {
|
for filename in files.iter() {
|
||||||
let filename: &str = filename;
|
let filename: &str = filename;
|
||||||
let mut stdin_buf;
|
let stdin_buf;
|
||||||
let mut file_buf;
|
let file_buf;
|
||||||
let mut file = BufReader::new(
|
let mut file = BufReader::new(
|
||||||
if filename == "-" {
|
if filename == "-" {
|
||||||
stdin_buf = stdin();
|
stdin_buf = stdin();
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open(path: String) -> BufReader<Box<Read+'static>> {
|
fn open(path: String) -> BufReader<Box<Read+'static>> {
|
||||||
let mut file_buf;
|
let file_buf;
|
||||||
if path == "-" {
|
if path == "-" {
|
||||||
BufReader::new(Box::new(stdin()) as Box<Read>)
|
BufReader::new(Box::new(stdin()) as Box<Read>)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ fn test_random() {
|
||||||
let mut factors = Vec::new();
|
let mut factors = Vec::new();
|
||||||
while product < min {
|
while product < min {
|
||||||
// log distribution---higher probability for lower numbers
|
// log distribution---higher probability for lower numbers
|
||||||
let mut factor;
|
let factor;
|
||||||
loop {
|
loop {
|
||||||
let next = rng.gen_range(0f64, LOG_PRIMES).exp2().floor() as usize;
|
let next = rng.gen_range(0f64, LOG_PRIMES).exp2().floor() as usize;
|
||||||
if next < NUM_PRIMES {
|
if next < NUM_PRIMES {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue