Use static tables

Using `static` instead of `const` reduces the size of output binaries, .rlib, and .rmeta.
This commit is contained in:
Mateo Guynn 2022-07-23 15:40:46 -07:00
parent 458f6ac314
commit 20050c68ce
2 changed files with 4 additions and 4 deletions

View File

@ -440,7 +440,7 @@ pub mod charwidth {
module.write(
f"""
/// Autogenerated. {subtable_count} sub-table(s). Consult [`lookup_width`] for layout info.
const TABLES_{i}: [u8; {len(byte_array)}] = ["""
static TABLES_{i}: [u8; {len(byte_array)}] = ["""
)
for (j, byte) in enumerate(byte_array):
# Add line breaks for every 15th entry (chosen to match what rustfmt does)

View File

@ -86,7 +86,7 @@ pub mod charwidth {
}
/// Autogenerated. 1 sub-table(s). Consult [`lookup_width`] for layout info.
const TABLES_0: [u8; 256] = [
static TABLES_0: [u8; 256] = [
0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
0x0E, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0F, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
0x03, 0x0F, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
@ -108,7 +108,7 @@ pub mod charwidth {
];
/// Autogenerated. 19 sub-table(s). Consult [`lookup_width`] for layout info.
const TABLES_1: [u8; 2432] = [
static TABLES_1: [u8; 2432] = [
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x06, 0x08, 0x06, 0x09, 0x0A, 0x0B, 0x0C,
0x0D, 0x0E, 0x0F, 0x10, 0x06, 0x06, 0x06, 0x11, 0x12, 0x13, 0x14, 0x06, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x22, 0x24, 0x25,
@ -275,7 +275,7 @@ pub mod charwidth {
];
/// Autogenerated. 240 sub-table(s). Consult [`lookup_width`] for layout info.
const TABLES_2: [u8; 3840] = [
static TABLES_2: [u8; 3840] = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5D, 0xD7, 0x77, 0x75, 0xFF,