Skip to content

Commit cd37df0

Browse files
committed
feat: implement AsRef<[u8]> for Identity type (#1006)
1 parent 6af8286 commit cd37df0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: packages/fuels-core/src/types/core/native.rs

+9
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,12 @@ impl Default for Identity {
1717
Self::Address(Address::default())
1818
}
1919
}
20+
21+
impl AsRef<[u8]> for Identity {
22+
fn as_ref(&self) -> &[u8] {
23+
match self {
24+
Identity::Address(address) => address.as_ref(),
25+
Identity::ContractId(contract_id) => contract_id.as_ref(),
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)