Commit 4010c866 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Fix clippy warnings

parent 54b81b9a
...@@ -14,9 +14,9 @@ fn main() { ...@@ -14,9 +14,9 @@ fn main() {
// Prepare i18n // Prepare i18n
setlocale(LocaleCategory::LcAll, ""); setlocale(LocaleCategory::LcAll, "");
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR)
.unwrap_or_else(|_| panic!("Unable to bind text domain for {}", GETTEXT_PACKAGE)); .unwrap_or_else(|_| panic!("Unable to bind text domain for {GETTEXT_PACKAGE}"));
textdomain(GETTEXT_PACKAGE) textdomain(GETTEXT_PACKAGE)
.unwrap_or_else(|_| panic!("Unable to switch to text domain {}", GETTEXT_PACKAGE)); .unwrap_or_else(|_| panic!("Unable to switch to text domain {GETTEXT_PACKAGE}"));
glib::set_application_name(&gettext("Tour")); glib::set_application_name(&gettext("Tour"));
glib::set_prgname(Some("Tour")); glib::set_prgname(Some("Tour"));
......
...@@ -5,7 +5,7 @@ use regex::{Captures, Regex}; ...@@ -5,7 +5,7 @@ use regex::{Captures, Regex};
pub fn i18n_f(format: &str, kwargs: &[(&str, &str)]) -> String { pub fn i18n_f(format: &str, kwargs: &[(&str, &str)]) -> String {
let mut s = gettext(format); let mut s = gettext(format);
for (k, v) in kwargs { for (k, v) in kwargs {
if let Ok(re) = Regex::new(&format!("\\{{{}\\}}", k)) { if let Ok(re) = Regex::new(&format!("\\{{{k}\\}}")) {
s = re s = re
.replace_all(&s, |_: &Captures<'_>| v.to_string()) .replace_all(&s, |_: &Captures<'_>| v.to_string())
.to_string(); .to_string();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment