🎨 Colapsa if anidados sugeridos por clippy
This commit is contained in:
parent
1cab0ae9a0
commit
502c00c891
5 changed files with 29 additions and 29 deletions
20
src/app.rs
20
src/app.rs
|
|
@ -84,16 +84,16 @@ impl Application {
|
|||
// Nombre de la aplicación, ajustado al ancho del terminal si es necesario.
|
||||
let mut app_ff = String::new();
|
||||
let app_name = &global::SETTINGS.app.name;
|
||||
if let Some((Width(term_width), _)) = terminal_size() {
|
||||
if term_width >= 80 {
|
||||
let maxlen: usize = ((term_width / 10) - 2).into();
|
||||
let mut app: String = app_name.chars().take(maxlen).collect();
|
||||
if app_name.chars().count() > maxlen {
|
||||
app = format!("{app}...");
|
||||
}
|
||||
if let Some(ff) = figfont::FIGFONT.convert(&app) {
|
||||
app_ff = ff.to_string();
|
||||
}
|
||||
if let Some((Width(term_width), _)) = terminal_size()
|
||||
&& term_width >= 80
|
||||
{
|
||||
let maxlen: usize = ((term_width / 10) - 2).into();
|
||||
let mut app: String = app_name.chars().take(maxlen).collect();
|
||||
if app_name.chars().count() > maxlen {
|
||||
app = format!("{app}...");
|
||||
}
|
||||
if let Some(ff) = figfont::FIGFONT.convert(&app) {
|
||||
app_ff = ff.to_string();
|
||||
}
|
||||
}
|
||||
if app_ff.is_empty() {
|
||||
|
|
|
|||
|
|
@ -103,10 +103,10 @@ impl Locale {
|
|||
}
|
||||
|
||||
// Si la variante regional no existe, retrocede al idioma base (p. ej. "es").
|
||||
if let Some((base_lang, _)) = lang.split_once('-') {
|
||||
if let Some(langid) = LANGUAGES.get(base_lang).map(|(langid, _)| langid) {
|
||||
return Self::Resolved(langid);
|
||||
}
|
||||
if let Some((base_lang, _)) = lang.split_once('-')
|
||||
&& let Some(langid) = LANGUAGES.get(base_lang).map(|(langid, _)| langid)
|
||||
{
|
||||
return Self::Resolved(langid);
|
||||
}
|
||||
|
||||
// En caso contrario, indica que el idioma no está soportado.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue