Skip to content

Commit 64f7f24

Browse files
committed
fix clippy
1 parent e8ca47e commit 64f7f24

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crates/yew-hooks/src/hooks/use_start_typing.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use yew::prelude::*;
88

99
use super::use_latest;
1010

11+
/// Type alias for key filter function to reduce type complexity
12+
type KeyFilter = Box<dyn Fn(&str) -> bool>;
13+
1114
/// A hook that triggers a callback when the user starts typing on the page
1215
/// without an editable element focused.
1316
///
@@ -98,7 +101,7 @@ pub struct UseStartTypingOptions {
98101
pub check_modifiers: bool,
99102
/// Custom function to determine if a key should trigger the callback.
100103
/// If not provided, defaults to checking if the key is alphanumeric.
101-
pub key_filter: Option<Box<dyn Fn(&str) -> bool>>,
104+
pub key_filter: Option<KeyFilter>,
102105
}
103106

104107
impl Default for UseStartTypingOptions {

0 commit comments

Comments
 (0)