Skip to content

Change tables from const to static #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def emit_module(
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)
Expand Down
6 changes: 3 additions & 3 deletions src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down