diff --git a/src/user_preferences/mod.rs b/src/user_preferences/mod.rs index aad7529..d5dfc97 100644 --- a/src/user_preferences/mod.rs +++ b/src/user_preferences/mod.rs @@ -6,6 +6,7 @@ pub mod v0; mod error; +use core::str::FromStr; use core::convert::TryFrom; pub use error::ParseError; @@ -164,6 +165,13 @@ impl TryFrom for UserPreferences { } } +impl FromStr for UserPreferences { + type Err = ParseError; + fn from_str(s: &str) -> Result { + UserPreferences::from_prefstring(s) + } +} + #[cfg(test)] mod test { use super::*;