diff --git a/src/tools/unicode-table-generator/src/main.rs b/src/tools/unicode-table-generator/src/main.rs index d2d1807b3bb..218e9668df4 100644 --- a/src/tools/unicode-table-generator/src/main.rs +++ b/src/tools/unicode-table-generator/src/main.rs @@ -315,7 +315,7 @@ fn version() -> String { fn fmt_list(values: impl IntoIterator) -> String { let pieces = values.into_iter().map(|b| format!("{:?}, ", b)).collect::>(); let mut out = String::new(); - let mut line = format!("\n "); + let mut line = String::from("\n "); for piece in pieces { if line.len() + piece.len() < 98 { line.push_str(&piece); diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs index 63cc29b670f..42e7e5fb406 100644 --- a/src/tools/unicode-table-generator/src/raw_emitter.rs +++ b/src/tools/unicode-table-generator/src/raw_emitter.rs @@ -20,7 +20,7 @@ impl RawEmitter { if self.file.is_empty() || self.file.ends_with("\n\n") { return; } - writeln!(&mut self.file, "").unwrap(); + writeln!(&mut self.file).unwrap(); } fn emit_bitset(&mut self, ranges: &[Range]) { @@ -161,10 +161,10 @@ pub fn emit_codepoints(emitter: &mut RawEmitter, ranges: &[Range]) { if bitset.bytes_used <= skiplist.bytes_used { *emitter = bitset; - emitter.desc = format!("bitset"); + emitter.desc = String::from("bitset"); } else { *emitter = skiplist; - emitter.desc = format!("skiplist"); + emitter.desc = String::from("skiplist"); } } @@ -289,7 +289,7 @@ impl Canonicalized { // Remove the now-canonicalized word from other mappings, // to ensure that we deprioritize them in the next iteration of // the while loop. - for (_, mapped) in &mut mappings { + for mapped in mappings.values_mut() { let mut i = 0; while i != mapped.len() { if mapped[i].0 == *from { @@ -309,7 +309,7 @@ impl Canonicalized { // Remove the now-canonical word from other mappings, to ensure that // we deprioritize them in the next iteration of the while loop. - for (_, mapped) in &mut mappings { + for mapped in mappings.values_mut() { let mut i = 0; while i != mapped.len() { if mapped[i].0 == to {