X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=rust%2Fsrc%2Flocale_charset.rs;h=596fd624066afbf6a8a81fd650e94f7a5201398f;hb=ad10c0fc07a3183f0a991b23d7523023baa9a098;hp=e967c1d46de35ee4689ebb15727ae4fb72651482;hpb=7b8c7d8e8e05793f456be2b4cd0a6aedf445439a;p=pspp diff --git a/rust/src/locale_charset.rs b/rust/src/locale_charset.rs index e967c1d46d..596fd62406 100644 --- a/rust/src/locale_charset.rs +++ b/rust/src/locale_charset.rs @@ -248,7 +248,7 @@ mod inner { let saved_locale = set_locale(LC_CTYPE, None); set_locale(LC_CTYPE, Some("")); let codeset = string_from_pointer(nl_langinfo(CODESET)); - set_locale(LC_CTYPE, saved_locale.as_ref().map(|x| x.as_str())); + set_locale(LC_CTYPE, saved_locale.as_deref()); codeset } } @@ -295,6 +295,8 @@ mod inner { } } +/// Returns the character set used by the locale configured in the operating +/// system. pub fn locale_charset() -> &'static str { lazy_static! { static ref LOCALE_CHARSET: &'static str =