mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-25 21:25:03 +00:00
impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) (#665)
* impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) * binaries
This commit is contained in:
1 parent
b50196b389
commit
07a59621cc
1 file changed
+10
-2
@@ -112,9 +112,17 @@ pub trait MaybeEmpty {
|
||||
fn is_empty(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<T: Default + PartialEq> MaybeEmpty for T {
|
||||
// AccountId is `u64` in tests
|
||||
impl MaybeEmpty for u64 {
|
||||
fn is_empty(&self) -> bool {
|
||||
*self == T::default()
|
||||
self.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
// AccountId is H256 in production
|
||||
impl MaybeEmpty for substrate_primitives::H256 {
|
||||
fn is_empty(&self) -> bool {
|
||||
self.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user