From 250c8120111fec68ef729cd16832da78b5cbdf9a Mon Sep 17 00:00:00 2001 From: jprochazk <1665677+jprochazk@users.noreply.github.com> Date: Wed, 29 May 2024 12:33:33 +0200 Subject: [PATCH] naming --- crates/eframe/src/web/mod.rs | 4 ++-- crates/eframe/src/web/text_agent.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/eframe/src/web/mod.rs b/crates/eframe/src/web/mod.rs index e5cdab9ad7d..7385ff4b63f 100644 --- a/crates/eframe/src/web/mod.rs +++ b/crates/eframe/src/web/mod.rs @@ -68,12 +68,12 @@ pub(crate) fn focused_element() -> Option { } pub(crate) fn has_focus(element: &T) -> bool { - fn inner(element: &T) -> Option { + fn try_has_focus(element: &T) -> Option { let element = element.dyn_ref::()?; let focused_element = focused_element()?; Some(element == &focused_element) } - inner(element).unwrap_or(false) + try_has_focus(element).unwrap_or(false) } /// Current time in seconds (since undefined point in time). diff --git a/crates/eframe/src/web/text_agent.rs b/crates/eframe/src/web/text_agent.rs index d723096b739..68c150f1b0c 100644 --- a/crates/eframe/src/web/text_agent.rs +++ b/crates/eframe/src/web/text_agent.rs @@ -166,7 +166,7 @@ impl Drop for TextAgent { /// Returns `true` if the app is likely running on a mobile device. fn is_mobile() -> bool { - fn inner() -> Option { + fn try_is_mobile() -> Option { const MOBILE_DEVICE: [&str; 6] = ["Android", "iPhone", "iPad", "iPod", "webOS", "BlackBerry"]; @@ -174,5 +174,5 @@ fn is_mobile() -> bool { let is_mobile = MOBILE_DEVICE.iter().any(|&name| user_agent.contains(name)); Some(is_mobile) } - inner().unwrap_or(false) + try_is_mobile().unwrap_or(false) }