🎨 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:
Manuel Cillero 2025-09-11 19:03:34 +02:00
parent 2a4d6a7890
commit ddf78c2de8
12 changed files with 29 additions and 29 deletions

View file

@ -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.