diff options
| author | Bruce A. MacNaughton <bruce.macnaughton@contrastsecurity.com> | 2022-07-20 16:13:54 -0700 |
|---|---|---|
| committer | Bruce A. MacNaughton <bruce.macnaughton@contrastsecurity.com> | 2022-07-20 16:13:54 -0700 |
| commit | 5d048eb69dc73aa6307f07ad6a21eee5e3e64c9f (patch) | |
| tree | 6c929620bba27d0f5e66cb3f1a219a2e21cc8d17 | |
| parent | e5d4de39128205eb322c1e38219c0969c9af625b (diff) | |
| download | rust-5d048eb69dc73aa6307f07ad6a21eee5e3e64c9f.tar.gz rust-5d048eb69dc73aa6307f07ad6a21eee5e3e64c9f.zip | |
add #inline
| -rw-r--r-- | library/core/src/unicode/unicode_data.rs | 1 | ||||
| -rw-r--r-- | src/tools/unicode-table-generator/src/cascading_map.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/unicode/unicode_data.rs b/library/core/src/unicode/unicode_data.rs index eb9334bdc6d..c1eff3a36e6 100644 --- a/library/core/src/unicode/unicode_data.rs +++ b/library/core/src/unicode/unicode_data.rs @@ -555,6 +555,7 @@ pub mod white_space { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]; + #[inline] pub fn lookup(c: char) -> bool { match c as u32 >> 8 { 0 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0, diff --git a/src/tools/unicode-table-generator/src/cascading_map.rs b/src/tools/unicode-table-generator/src/cascading_map.rs index d4efdef2e80..02c7542309a 100644 --- a/src/tools/unicode-table-generator/src/cascading_map.rs +++ b/src/tools/unicode-table-generator/src/cascading_map.rs @@ -63,6 +63,7 @@ impl RawEmitter { .unwrap(); self.bytes_used += 256; + writeln!(&mut self.file, "#[inline]").unwrap(); writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap(); writeln!(&mut self.file, " match c as u32 >> 8 {{").unwrap(); for arm in arms { |
