diff --git a/Cargo.lock b/Cargo.lock index 9d99a4b..ed4ad80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1640,7 +1640,6 @@ name = "parsing" version = "0.1.0" dependencies = [ "exmex", - "lazy_static", "phf", "phf_codegen", ] @@ -2793,7 +2792,6 @@ dependencies = [ "getrandom", "instant", "itertools", - "lazy_static", "parsing", "rayon", "run_script", diff --git a/Cargo.toml b/Cargo.toml index 8c29dfc..753deeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,6 @@ emath = { git = "https://github.com/Titaniumtown/egui.git", default-features = f shadow-rs = { version = "0.11", default-features = false } const_format = { version = "0.2", default-features = false, features = ["fmt"] } cfg-if = "1" -lazy_static = "1" ruzstd = { git = "https://github.com/Titaniumtown/zstd-rs.git", branch = "ringbuffer" } tracing = "0.1" itertools = "0.10" diff --git a/parsing/Cargo.toml b/parsing/Cargo.toml index 91f3962..45d9278 100644 --- a/parsing/Cargo.toml +++ b/parsing/Cargo.toml @@ -14,7 +14,6 @@ phf = { version = "0.10", no-default-features = true } exmex = { git = "https://github.com/bertiqwerty/exmex.git", branch = "main", features = [ "partial", ] } -lazy_static = "1.4" [build-dependencies] phf_codegen = { version = "0.10", no-default-features = true } diff --git a/src/consts.rs b/src/consts.rs index 41318e0..619f08a 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -50,25 +50,3 @@ pub const COLORS: [Color32; 13] = [ ]; const_assert!(!COLORS.is_empty()); - -#[cfg(target_arch = "wasm32")] -lazy_static::lazy_static! { - static ref IS_MOBILE: bool = { - // from https://github.com/emilk/egui/blob/fda8189cbab18e0acab8db972400e4a4ca0d915e/egui_web/src/text_agent.rs#L194 - fn is_mobile() -> Option { - const MOBILE_DEVICE: [&str; 6] = ["Android", "iPhone", "iPad", "iPod", "webOS", "BlackBerry"]; - - let user_agent = web_sys::window()?.navigator().user_agent().ok()?; - Some(MOBILE_DEVICE.iter().any(|&name| user_agent.contains(name))) - } - - is_mobile().unwrap_or_default() - }; -} - -#[inline] -#[cfg(target_arch = "wasm32")] -pub fn is_mobile() -> bool { return *IS_MOBILE; } - -#[cfg(not(target_arch = "wasm32"))] -pub const fn is_mobile() -> bool { false } diff --git a/src/function_manager.rs b/src/function_manager.rs index 3b8a8da..697b23f 100644 --- a/src/function_manager.rs +++ b/src/function_manager.rs @@ -1,4 +1,3 @@ -use crate::consts::is_mobile; use crate::function_entry::FunctionEntry; use crate::misc::random_u64; use crate::widgets::widgets_ontop; @@ -109,7 +108,7 @@ impl FunctionManager { function.autocomplete.update_string(&new_string); if function.autocomplete.hint.is_some() { - if !function.autocomplete.hint.is_single() && !is_mobile() { + if !function.autocomplete.hint.is_single() { if ui.input().key_pressed(Key::ArrowDown) { movement = Movement::Down; } else if ui.input().key_pressed(Key::ArrowUp) { @@ -118,11 +117,7 @@ impl FunctionManager { } // Put here so these key presses don't interact with other elements - let enter_pressed = match is_mobile() { - true => false, - false => ui.input_mut().consume_key(Modifiers::NONE, Key::Enter), - }; - + let enter_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Enter); let tab_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Tab); if enter_pressed | tab_pressed | ui.input().key_pressed(Key::ArrowRight) { movement = Movement::Complete;