Update doc-strings

This commit is contained in:
juliancoffee 2021-04-25 09:12:15 +03:00
parent 79cb7a5826
commit 8fd1037bf3

View File

@ -99,9 +99,6 @@ pub struct LocalizationFragment {
impl Language { impl Language {
/// Get a localized text from the given key /// Get a localized text from the given key
///
/// If the key is not present in the localization object
/// then the key is returned.
pub fn get<'a>(&'a self, key: &'a str) -> Option<&str> { pub fn get<'a>(&'a self, key: &'a str) -> Option<&str> {
self.string_map.get(key).map(|s| s.as_str()) self.string_map.get(key).map(|s| s.as_str())
} }
@ -242,6 +239,8 @@ pub type Localization = LocalizationGuard;
impl LocalizationGuard { impl LocalizationGuard {
/// Get a localized text from the given key /// Get a localized text from the given key
/// ///
/// First lookup is done in the active language, second in
/// the fallback (if present).
/// If the key is not present in the localization object /// If the key is not present in the localization object
/// then the key is returned. /// then the key is returned.
pub fn get<'a>(&'a self, key: &'a str) -> &str { pub fn get<'a>(&'a self, key: &'a str) -> &str {