Skip to content

Commit ba6b427

Browse files
committed
unicode_table_generator: fix clippy::writeln_empty_string, clippy::useless_format, clippy:::for_kv_map
1 parent ebac0e4 commit ba6b427

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/tools/unicode-table-generator/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn version() -> String {
315315
fn fmt_list<V: std::fmt::Debug>(values: impl IntoIterator<Item = V>) -> String {
316316
let pieces = values.into_iter().map(|b| format!("{:?}, ", b)).collect::<Vec<_>>();
317317
let mut out = String::new();
318-
let mut line = format!("\n ");
318+
let mut line = String::from("\n ");
319319
for piece in pieces {
320320
if line.len() + piece.len() < 98 {
321321
line.push_str(&piece);

src/tools/unicode-table-generator/src/raw_emitter.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl RawEmitter {
2020
if self.file.is_empty() || self.file.ends_with("\n\n") {
2121
return;
2222
}
23-
writeln!(&mut self.file, "").unwrap();
23+
writeln!(&mut self.file).unwrap();
2424
}
2525

2626
fn emit_bitset(&mut self, ranges: &[Range<u32>]) {
@@ -161,10 +161,10 @@ pub fn emit_codepoints(emitter: &mut RawEmitter, ranges: &[Range<u32>]) {
161161

162162
if bitset.bytes_used <= skiplist.bytes_used {
163163
*emitter = bitset;
164-
emitter.desc = format!("bitset");
164+
emitter.desc = String::from("bitset");
165165
} else {
166166
*emitter = skiplist;
167-
emitter.desc = format!("skiplist");
167+
emitter.desc = String::from("skiplist");
168168
}
169169
}
170170

@@ -289,7 +289,7 @@ impl Canonicalized {
289289
// Remove the now-canonicalized word from other mappings,
290290
// to ensure that we deprioritize them in the next iteration of
291291
// the while loop.
292-
for (_, mapped) in &mut mappings {
292+
for mapped in mappings.values_mut() {
293293
let mut i = 0;
294294
while i != mapped.len() {
295295
if mapped[i].0 == *from {
@@ -309,7 +309,7 @@ impl Canonicalized {
309309

310310
// Remove the now-canonical word from other mappings, to ensure that
311311
// we deprioritize them in the next iteration of the while loop.
312-
for (_, mapped) in &mut mappings {
312+
for mapped in mappings.values_mut() {
313313
let mut i = 0;
314314
while i != mapped.len() {
315315
if mapped[i].0 == to {

0 commit comments

Comments
 (0)