aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/config.rs b/src/config.rs
deleted file mode 100644
index bc86613..0000000
--- a/src/config.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Do not change
-pub const NUM_KEYS: usize = 30;
-pub const ROW_LENGTH: usize = 10;
-
-pub const KEY_CHARS: [char; NUM_KEYS] = [
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
- 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '/', '.', ',', '\'',
-];
-
-pub const KEY_TO_FINGER: [usize; NUM_KEYS] = [
- 0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 0, 1, 2, 3, 3, 4, 4, 5, 6, 7,
-];
-
-pub fn canonicalise(inp: char) -> Option<char> {
- if inp.is_ascii_alphabetic() {
- return Some(inp.to_ascii_uppercase());
- } else {
- match inp {
- '.' => Some('.'),
- '>' => Some('.'),
- ',' => Some(','),
- '<' => Some(','),
- '/' => Some('/'),
- '?' => Some('/'),
- '\'' => Some('\''),
- '"' => Some('\''),
- _ => None,
- }
- }
-}
-
-const fn build_lookup_table() -> [usize; 128] {
- let mut result = [0; 128];
- let mut i = 0;
-
- while i < NUM_KEYS {
- result[KEY_CHARS[i] as usize] = i;
- i += 1;
- }
- return result;
-}
-
-pub const CHAR_TO_INDEX: [usize; 128] = build_lookup_table();