diff --git a/localization/po/de.po b/localization/po/de.po index 6fb333268..2aa2ab436 100644 --- a/localization/po/de.po +++ b/localization/po/de.po @@ -539,10 +539,6 @@ msgstr "%s: Nicht innerhalb einer Schleife" msgid "%s: Number out of range" msgstr "" -#, c-format -msgid "%s: Number was empty" -msgstr "%s: Zahl war leer" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/en.po b/localization/po/en.po index f7c594225..0225b20a2 100644 --- a/localization/po/en.po +++ b/localization/po/en.po @@ -539,10 +539,6 @@ msgstr "%s: Not inside of loop" msgid "%s: Number out of range" msgstr "" -#, c-format -msgid "%s: Number was empty" -msgstr "" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/es.po b/localization/po/es.po index be91cf8d6..8170209bc 100644 --- a/localization/po/es.po +++ b/localization/po/es.po @@ -539,10 +539,6 @@ msgstr "%s: No está dentro de un bucle" msgid "%s: Number out of range" msgstr "%s: Número fuera de rango" -#, c-format -msgid "%s: Number was empty" -msgstr "%s: El número estaba vacío" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "%s: Las opciones %s y %s no pueden usarse juntas" diff --git a/localization/po/fr.po b/localization/po/fr.po index 9620c637f..54b5bb739 100644 --- a/localization/po/fr.po +++ b/localization/po/fr.po @@ -668,10 +668,6 @@ msgstr "%s : À l’extérieur de toute boucle" msgid "%s: Number out of range" msgstr "%s : Nombre hors limites" -#, c-format -msgid "%s: Number was empty" -msgstr "" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/ja_JP.po b/localization/po/ja_JP.po index 1082e9fde..d7d3eecce 100644 --- a/localization/po/ja_JP.po +++ b/localization/po/ja_JP.po @@ -538,10 +538,6 @@ msgstr "%s: ループ内ではありません" msgid "%s: Number out of range" msgstr "%s: 数値が範囲外です" -#, c-format -msgid "%s: Number was empty" -msgstr "%s: 数値が空です" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "%s: オプション %s と %s は同時には指定できません" diff --git a/localization/po/pl.po b/localization/po/pl.po index 09e984c9c..02be7cc2b 100644 --- a/localization/po/pl.po +++ b/localization/po/pl.po @@ -535,10 +535,6 @@ msgstr "" msgid "%s: Number out of range" msgstr "" -#, c-format -msgid "%s: Number was empty" -msgstr "" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/pt_BR.po b/localization/po/pt_BR.po index 2fd5ae71c..eb857a5fe 100644 --- a/localization/po/pt_BR.po +++ b/localization/po/pt_BR.po @@ -540,10 +540,6 @@ msgstr "%s: Não está dentro de laço" msgid "%s: Number out of range" msgstr "" -#, c-format -msgid "%s: Number was empty" -msgstr "" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/sv.po b/localization/po/sv.po index ef6faab97..87cf19320 100644 --- a/localization/po/sv.po +++ b/localization/po/sv.po @@ -536,10 +536,6 @@ msgstr "%s: Inte i en loop" msgid "%s: Number out of range" msgstr "" -#, c-format -msgid "%s: Number was empty" -msgstr "" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "" diff --git a/localization/po/zh_CN.po b/localization/po/zh_CN.po index a1a65519a..3bec682e0 100644 --- a/localization/po/zh_CN.po +++ b/localization/po/zh_CN.po @@ -560,10 +560,6 @@ msgstr "%s: 不在循环体内部" msgid "%s: Number out of range" msgstr "%s:数字超出范围" -#, c-format -msgid "%s: Number was empty" -msgstr "%s:数字为空" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "%s: 选项 %s 和 %s 无法一起使用" diff --git a/localization/po/zh_TW.po b/localization/po/zh_TW.po index 5b91938ea..395abe676 100644 --- a/localization/po/zh_TW.po +++ b/localization/po/zh_TW.po @@ -533,10 +533,6 @@ msgstr "%s:不在迴圈裡面" msgid "%s: Number out of range" msgstr "%s:數字超出範圍" -#, c-format -msgid "%s: Number was empty" -msgstr "%s:數字空白" - #, c-format msgid "%s: Options %s and %s cannot be used together" msgstr "%s:選項 %s 和 %s 不能同時使用" diff --git a/src/builtins/printf.rs b/src/builtins/printf.rs index b301d0176..7480c2ad0 100644 --- a/src/builtins/printf.rs +++ b/src/builtins/printf.rs @@ -205,16 +205,13 @@ impl<'a, 'b> builtin_printf_state_t<'a, 'b> { fn verify_numeric(&mut self, s: &wstr, end: &wstr, errcode: Option) { // This check matches the historic `errcode != EINVAL` check from C++. // Note that empty or missing values will be silently treated as 0. - if errcode != None && errcode != Some(Error::InvalidChar) && errcode != Some(Error::Empty) { + if errcode.is_some_and(|err| err != Error::InvalidChar && err != Error::Empty) { match errcode.unwrap() { Error::Overflow => { self.fatal_error(wgettext_fmt!("%s: Number out of range", s)); } - Error::Empty => { - self.fatal_error(wgettext_fmt!("%s: Number was empty", s)); - } - Error::InvalidChar => { - panic!("Unreachable"); + Error::InvalidChar | Error::Empty => { + unreachable!("Unreachable"); } } } else if !end.is_empty() {