Skip to content

Commit c5554ab

Browse files
cakebakerRenjiSann
authored andcommitted
clippy: re-enable unnecessary_semicolon lint
1 parent e84b261 commit c5554ab

File tree

12 files changed

+14
-15
lines changed

12 files changed

+14
-15
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@ enum_glob_use = "allow"
675675
ptr_cast_constness = "allow"
676676
borrow_as_ptr = "allow"
677677
ptr_as_ptr = "allow"
678-
unnecessary_semicolon = "allow"
679678
needless_raw_string_hashes = "allow"
680679
unreadable_literal = "allow"
681680
unnested_or_patterns = "allow"

src/uu/cksum/src/cksum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn print_legacy_checksum(
130130
print!("{sum} {size}");
131131
}
132132
_ => unreachable!("Not a legacy algorithm"),
133-
};
133+
}
134134

135135
// Print the filename after a space if not stdin
136136
if filename != "-" {

src/uu/seq/src/numberparse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
7676
// Also ignore overflowed exponents (unwrap_or(0)).
7777
if exp > 0 {
7878
int_digits += exp.try_into().unwrap_or(0);
79-
};
79+
}
8080
frac_digits = if exp < frac_digits as i64 {
8181
// Subtract from i128 to avoid any overflow
8282
(frac_digits as i128 - exp as i128).try_into().unwrap_or(0)

src/uucore/src/lib/features/checksum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ fn process_checksum_file(
11251125
Err(CantOpenFile | FileIsDirectory) => res.failed_open_file += 1,
11261126
Err(FileNotFound) if !opts.ignore_missing => res.failed_open_file += 1,
11271127
_ => (),
1128-
};
1128+
}
11291129
}
11301130

11311131
// not a single line correctly formatted found

src/uucore/src/lib/features/format/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<C: FormatChar> FormatItem<C> {
192192
match self {
193193
Self::Spec(spec) => spec.write(writer, args)?,
194194
Self::Char(c) => return c.write(writer).map_err(FormatError::IoError),
195-
};
195+
}
196196
Ok(ControlFlow::Continue(()))
197197
}
198198
}

src/uucore/src/lib/features/format/num_format.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl Formatter<&ExtendedBigDecimal> for Float {
276276
// Pad non-finite numbers with spaces, not zeros.
277277
if alignment == NumberAlignment::RightZero {
278278
alignment = NumberAlignment::RightSpace;
279-
};
279+
}
280280
format_float_non_finite(&abs, self.case)
281281
}
282282
};
@@ -519,7 +519,7 @@ fn format_float_shortest(
519519
output.push_str(first_digits);
520520
output.push('.');
521521
output.push_str(remaining_digits);
522-
};
522+
}
523523

524524
if force_decimal == ForceDecimal::No {
525525
strip_fractional_zeroes_and_dot(&mut output);
@@ -636,7 +636,7 @@ fn format_float_hexadecimal(
636636
}
637637
} else {
638638
frac2 <<= wanted_bits - bits;
639-
};
639+
}
640640

641641
// Convert "XXX" to "X.XX": that divides by 16^precision = 2^(4*precision), so add that to the exponent.
642642
let mut digits = frac2.to_str_radix(16);

src/uucore/src/lib/features/format/spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl Spec {
398398
// TODO: This should break the _entire execution_ of printf
399399
break;
400400
}
401-
};
401+
}
402402
}
403403
writer.write_all(&parsed).map_err(FormatError::IoError)
404404
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl MountInfo {
243243
mount_option = String::from_utf8_lossy(raw[3]).to_string();
244244
}
245245
_ => return None,
246-
};
246+
}
247247

248248
let dev_id = mount_dev_id(&mount_dir);
249249
let dummy = is_dummy_filesystem(&fs_type, &mount_option);

src/uucore/src/lib/features/mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn parse_change(mode: &str, fperm: u32, considering_dir: bool) -> (u32, usize) {
119119
'g' => srwx = ((fperm << 3) & 0o700) | (fperm & 0o070) | ((fperm >> 3) & 0o007),
120120
'o' => srwx = ((fperm << 6) & 0o700) | ((fperm << 3) & 0o070) | (fperm & 0o007),
121121
_ => break,
122-
};
122+
}
123123
if ch == 'u' || ch == 'g' || ch == 'o' {
124124
// symbolic modes only allows perms to be a single letter of 'ugo'
125125
// therefore this must either be the first char or it is unexpected

src/uucore/src/lib/features/perms.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
125125
entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
126126
)
127127
};
128-
};
128+
}
129129
}
130130
}
131131
return Err(out);
@@ -157,7 +157,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
157157
};
158158
}
159159
_ => (),
160-
};
160+
}
161161
} else if verbosity.level == VerbosityLevel::Verbose {
162162
out = if verbosity.groups_only {
163163
format!(

0 commit comments

Comments
 (0)