mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 08:37:56 +00:00
Remove unnecessary cloning (#4263)
Seems like Externalities already [return a vector](https://github.com/paritytech/polkadot-sdk/blob/ffbce2a817ec2e7c8b7ce49f7ed6794584f19667/substrate/primitives/externalities/src/lib.rs#L86), so calling `to_vec` on a vector just results in an unneeded copying. Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
committed by
GitHub
parent
e0584a153d
commit
c594b10a80
@@ -182,7 +182,7 @@ impl From<MultiRemovalResults> for KillStorageResult {
|
||||
pub trait Storage {
|
||||
/// Returns the data for `key` in the storage or `None` if the key can not be found.
|
||||
fn get(&self, key: &[u8]) -> Option<bytes::Bytes> {
|
||||
self.storage(key).map(|s| bytes::Bytes::from(s.to_vec()))
|
||||
self.storage(key).map(bytes::Bytes::from)
|
||||
}
|
||||
|
||||
/// Get `key` from storage, placing the value into `value_out` and return the number of
|
||||
|
||||
Reference in New Issue
Block a user