Skip to content

Commit 7ebb6ee

Browse files
committed
[libstd_unicode] Change UNICODE_VERSION to use u32
Use `u32` for version components, as `u64` is just an overkill, and `u32` is the default type for integers and the default type used for regular internal numbers. There's no expectation for Unicode Versions to even reach one thousand in the next hundered years. This is different from *package versions*, which may become something auto-generated and exceed human-friendly range of integer values.
1 parent d361efa commit 7ebb6ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/libstd_unicode/tables.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/// The version of [Unicode](http://www.unicode.org/)
1616
/// that the unicode parts of `CharExt` and `UnicodeStrPrelude` traits are based on.
17-
pub const UNICODE_VERSION: (u64, u64, u64) = (10, 0, 0);
17+
pub const UNICODE_VERSION: (u32, u32, u32) = (10, 0, 0);
1818

1919

2020
// BoolTrie is a trie for representing a set of Unicode codepoints. It is

Diff for: src/libstd_unicode/unicode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def emit_norm_module(f, canon, compat, combine, norm_props):
562562
rf.write("""
563563
/// The version of [Unicode](http://www.unicode.org/)
564564
/// that the unicode parts of `CharExt` and `UnicodeStrPrelude` traits are based on.
565-
pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s);
565+
pub const UNICODE_VERSION: (u32, u32, u32) = (%s, %s, %s);
566566
""" % unicode_version)
567567
(canon_decomp, compat_decomp, gencats, combines,
568568
to_upper, to_lower, to_title) = load_unicode_data("UnicodeData.txt")

0 commit comments

Comments
 (0)