diff --git a/src/use_locale.rs b/src/use_locale.rs index be781a4..ff69e7f 100644 --- a/src/use_locale.rs +++ b/src/use_locale.rs @@ -58,13 +58,13 @@ where .map(|l| l.as_ref().clone()) .collect::>(); - const EMPTY_ERR_MSG: &'static str = "Empty supported list. You have to provide at least one locale in the `supported` parameter"; - assert!(supported.len() > 0, "{}", EMPTY_ERR_MSG); + const EMPTY_ERR_MSG: & str = "Empty supported list. You have to provide at least one locale in the `supported` parameter"; + assert!(!supported.is_empty(), "{}", EMPTY_ERR_MSG); Signal::derive(move || { let supported = supported.clone(); - client_locales.with(|clienht_locales| { + client_locales.with(|client_locales| { let mut first_supported = None; for s in supported { @@ -72,7 +72,7 @@ where first_supported = Some(s.clone()); } - for client_locale in clienht_locales { + for client_locale in client_locales { let client_locale: LanguageIdentifier = client_locale .parse() .expect("Client should provide a list of valid unicode locales");