[lib] Impl FromStr for UserPreferences
This commit is contained in:
parent
7fb9ed0119
commit
c4b8b55414
|
@ -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<Intermediary> for UserPreferences {
|
|||
}
|
||||
}
|
||||
|
||||
impl FromStr for UserPreferences {
|
||||
type Err = ParseError;
|
||||
fn from_str(s: &str) -> Result<Self, ParseError> {
|
||||
UserPreferences::from_prefstring(s)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
|
Loading…
Reference in a new issue