🎨 Unifica conversiones a String con to_string()
Como `String::from()` y `.to_string()` son equivalentes, se sustituyen todas las ocurrencias de `String::from()` por `to_string()` para mayor coherencia y legibilidad.
This commit is contained in:
parent
2a4d6a7890
commit
ddf78c2de8
12 changed files with 29 additions and 29 deletions
|
@ -165,7 +165,7 @@ pub trait LangId {
|
|||
///
|
||||
/// // Idioma no soportado.
|
||||
/// let lang = LangMatch::resolve("ja-JP");
|
||||
/// assert_eq!(lang, LangMatch::Unsupported(String::from("ja-JP")));
|
||||
/// assert_eq!(lang, LangMatch::Unsupported("ja-JP".to_string()));
|
||||
/// ```
|
||||
///
|
||||
/// Con la siguiente instrucción siempre se obtiene un [`LanguageIdentifier`] válido, ya sea porque
|
||||
|
@ -222,7 +222,7 @@ impl LangMatch {
|
|||
}
|
||||
|
||||
// En caso contrario, indica que el idioma no está soportado.
|
||||
Self::Unsupported(String::from(language))
|
||||
Self::Unsupported(language.to_string())
|
||||
}
|
||||
|
||||
/// Devuelve el [`LanguageIdentifier`] si el idioma fue reconocido.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue