Skip to content
Merged
12 changes: 1 addition & 11 deletions crates/storage/src/lazy/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,11 @@ where
V: Packed,
KeyType: StorageKey,
{
/// Insert the given `value` to the contract storage.
#[inline]
pub fn insert<Q, R>(&mut self, key: Q, value: &R)
where
Q: scale::EncodeLike<K>,
R: Storable + scale::EncodeLike<V>,
{
ink_env::set_contract_storage(&(&KeyType::KEY, key), value);
}

/// Insert the given `value` to the contract storage.
///
/// Returns the size of the pre-existing value at the specified key if any.
#[inline]
pub fn insert_return_size<Q, R>(&mut self, key: Q, value: &R) -> Option<u32>
pub fn insert<Q, R>(&mut self, key: Q, value: &R) -> Option<u32>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the docs can you also specify the returned size is in bytes?

where
Q: scale::EncodeLike<K>,
R: Storable + scale::EncodeLike<V>,
Expand Down