Update example to show props deriving, text macro, etc

This commit is contained in:
Ryan McGrath 2019-06-05 21:49:41 -07:00
parent 290b57d336
commit 241cae3c93
No known key found for this signature in database
GPG key ID: 811674B62B666830
7 changed files with 50 additions and 24 deletions

View file

@ -121,6 +121,21 @@ where
}
}
impl<'a, A: Ord + FromStr> From<&Vec<&'a str>> for SpacedSet<A>
where
<A as FromStr>::Err: Debug,
{
fn from(s: &Vec<&'a str>) -> Self {
let mut list = Self::new();
for key in s {
list.insert(FromStr::from_str(key).unwrap());
}
list
}
}
impl<'a, 'b, A: Ord + FromStr> From<(&'a str, &'b str)> for SpacedSet<A>
where
<A as FromStr>::Err: Debug,