chore: clippy

This commit is contained in:
dundargoc 2024-02-06 23:18:27 +01:00 committed by Amaan Qureshi
parent a1870b6013
commit c8bd6705cf
No known key found for this signature in database
GPG key ID: E67890ADC4227273
36 changed files with 467 additions and 462 deletions

View file

@ -11,7 +11,7 @@ pub struct Rand(StdRng);
impl Rand {
pub fn new(seed: usize) -> Self {
Rand(StdRng::seed_from_u64(seed as u64))
Self(StdRng::seed_from_u64(seed as u64))
}
pub fn unsigned(&mut self, max: usize) -> usize {
@ -24,9 +24,9 @@ impl Rand {
for i in 0..word_count {
if i > 0 {
if self.unsigned(5) == 0 {
result.push('\n' as u8);
result.push(b'\n');
} else {
result.push(' ' as u8);
result.push(b' ');
}
}
if self.unsigned(3) == 0 {
@ -34,7 +34,7 @@ impl Rand {
result.push(OPERATORS[index] as u8);
} else {
for _ in 0..self.unsigned(8) {
result.push(self.0.sample(Alphanumeric) as u8);
result.push(self.0.sample(Alphanumeric));
}
}
}