More work on governance.

This commit is contained in:
Gav
2018-02-28 21:01:35 +01:00
parent 93ac92dfb2
commit aa675add28
2 changed files with 66 additions and 28 deletions
+10
View File
@@ -112,6 +112,16 @@ impl Slicable for Vec<u8> {
}
}
impl Slicable for Vec<bool> {
fn decode<I: Input>(input: &mut I) -> Option<Self> {
<Vec<u8>>::decode(input).map(|a| a.into_iter().map(|b| b != 0).collect())
}
fn encode(&self) -> Vec<u8> {
<Vec<u8>>::encode(&self.iter().map(|&b| if b {1} else {0}).collect())
}
}
macro_rules! impl_vec_simple_array {
($($size:expr),*) => {
$(