diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-22 19:05:04 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-22 19:11:29 -0400 |
| commit | c682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch) | |
| tree | 0c31b640e3faacfb187a1509e3da5d5b6ba0109c /src/tools/unicode-table-generator | |
| parent | 1173204b364841b51598744fc69d7c80be10f956 (diff) | |
| download | rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.tar.gz rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.zip | |
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'src/tools/unicode-table-generator')
| -rw-r--r-- | src/tools/unicode-table-generator/src/case_mapping.rs | 2 | ||||
| -rw-r--r-- | src/tools/unicode-table-generator/src/main.rs | 2 | ||||
| -rw-r--r-- | src/tools/unicode-table-generator/src/raw_emitter.rs | 48 |
3 files changed, 23 insertions, 29 deletions
diff --git a/src/tools/unicode-table-generator/src/case_mapping.rs b/src/tools/unicode-table-generator/src/case_mapping.rs index f28161c7829..00241b7ee0e 100644 --- a/src/tools/unicode-table-generator/src/case_mapping.rs +++ b/src/tools/unicode-table-generator/src/case_mapping.rs @@ -2,7 +2,7 @@ use std::char; use std::collections::BTreeMap; use std::fmt::{self, Write}; -use crate::{fmt_list, UnicodeData}; +use crate::{UnicodeData, fmt_list}; const INDEX_MASK: u32 = 1 << 22; diff --git a/src/tools/unicode-table-generator/src/main.rs b/src/tools/unicode-table-generator/src/main.rs index 9f89e7c33f7..e1832091d70 100644 --- a/src/tools/unicode-table-generator/src/main.rs +++ b/src/tools/unicode-table-generator/src/main.rs @@ -82,7 +82,7 @@ mod raw_emitter; mod skiplist; mod unicode_download; -use raw_emitter::{emit_codepoints, emit_whitespace, RawEmitter}; +use raw_emitter::{RawEmitter, emit_codepoints, emit_whitespace}; static PROPERTIES: &[&str] = &[ "Alphabetic", diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs index 47120e4f169..bfffa1eee60 100644 --- a/src/tools/unicode-table-generator/src/raw_emitter.rs +++ b/src/tools/unicode-table-generator/src/raw_emitter.rs @@ -360,15 +360,12 @@ impl Canonicalized { let unique_mapping = unique_mapping .into_iter() .map(|(key, value)| { - ( - key, - match value { - UniqueMapping::Canonicalized(idx) => { - u8::try_from(canonical_words.len() + idx).unwrap() - } - UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), - }, - ) + (key, match value { + UniqueMapping::Canonicalized(idx) => { + u8::try_from(canonical_words.len() + idx).unwrap() + } + UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), + }) }) .collect::<HashMap<_, _>>(); @@ -383,24 +380,21 @@ impl Canonicalized { let canonicalized_words = canonicalized_words .into_iter() .map(|v| { - ( - u8::try_from(v.0).unwrap(), - match v.1 { - Mapping::RotateAndInvert(amount) => { - assert_eq!(amount, amount & LOWER_6); - 1 << 6 | (amount as u8) - } - Mapping::Rotate(amount) => { - assert_eq!(amount, amount & LOWER_6); - amount as u8 - } - Mapping::Invert => 1 << 6, - Mapping::ShiftRight(shift_by) => { - assert_eq!(shift_by, shift_by & LOWER_6); - 1 << 7 | (shift_by as u8) - } - }, - ) + (u8::try_from(v.0).unwrap(), match v.1 { + Mapping::RotateAndInvert(amount) => { + assert_eq!(amount, amount & LOWER_6); + 1 << 6 | (amount as u8) + } + Mapping::Rotate(amount) => { + assert_eq!(amount, amount & LOWER_6); + amount as u8 + } + Mapping::Invert => 1 << 6, + Mapping::ShiftRight(shift_by) => { + assert_eq!(shift_by, shift_by & LOWER_6); + 1 << 7 | (shift_by as u8) + } + }) }) .collect::<Vec<(u8, u8)>>(); Canonicalized { unique_mapping, canonical_words, canonicalized_words } |
