Skip to content

Commit

Permalink
pango: Manually implement Language::to_string & Language::default
Browse files Browse the repository at this point in the history
To avoid an API break for 0.16
  • Loading branch information
bilelmoussaoui committed Dec 5, 2022
1 parent c40aa68 commit b1a4f62
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pango/src/language.rs
Expand Up @@ -41,12 +41,21 @@ impl Language {
Self::from_glib_full_as_vec(ptr)
}
}

pub fn to_string(&self) -> glib::GString {
self.to_str()
}
}

impl FromStr for Language {
type Err = std::convert::Infallible;

fn from_str(language: &str) -> Result<Self, Self::Err> {
Ok(Self::from_string(language))
}
}

impl Default for Language {
fn default() -> Self {
Self::default()
}
}

0 comments on commit b1a4f62

Please sign in to comment.