questionable patch for TreeHashVector

This commit is contained in:
Michael Sproul 2019-04-17 11:29:06 +10:00
parent d95ae95ce8
commit 701cc00d08
No known key found for this signature in database
GPG Key ID: 77B1309D2E54E914
2 changed files with 7 additions and 1 deletions

View File

@ -27,7 +27,7 @@ impl ExpectedState {
($field_name:ident) => {
if self.$field_name.as_ref().map_or(true, |$field_name| {
println!(" > Checking {}", stringify!($field_name));
$field_name == &state.$field_name
&state.$field_name == $field_name
}) {
vec![]
} else {

View File

@ -33,6 +33,12 @@ impl<T> DerefMut for TreeHashVector<T> {
}
}
impl<T: PartialEq> PartialEq<Vec<T>> for TreeHashVector<T> {
fn eq(&self, other: &Vec<T>) -> bool {
&self.0 == other
}
}
impl<T> tree_hash::TreeHash for TreeHashVector<T>
where
T: TreeHash,