mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
Remove some last AccountId32::default() leftovers (#10655)
* Remove some last `AccountId32::default()` leftovers As we removed `Default` of account id, we have overseen some last bits. This pr removes these last bits. * Fix
This commit is contained in:
@@ -478,9 +478,7 @@ pub trait Public: ByteArray + Derive + CryptoType + PartialEq + Eq + Clone + Sen
|
||||
}
|
||||
|
||||
/// An opaque 32-byte cryptographic identifier.
|
||||
#[derive(
|
||||
Clone, Eq, PartialEq, Ord, PartialOrd, Default, Encode, Decode, MaxEncodedLen, TypeInfo,
|
||||
)]
|
||||
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Hash))]
|
||||
pub struct AccountId32([u8; 32]);
|
||||
|
||||
@@ -541,9 +539,9 @@ impl<'a> sp_std::convert::TryFrom<&'a [u8]> for AccountId32 {
|
||||
type Error = ();
|
||||
fn try_from(x: &'a [u8]) -> Result<AccountId32, ()> {
|
||||
if x.len() == 32 {
|
||||
let mut r = AccountId32::default();
|
||||
r.0.copy_from_slice(x);
|
||||
Ok(r)
|
||||
let mut data = [0; 32];
|
||||
data.copy_from_slice(x);
|
||||
Ok(AccountId32(data))
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user