Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections to MapView after the introduction of ValueOrBytes. #3046

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MathieuDutSik
Copy link
Contributor

@MathieuDutSik MathieuDutSik commented Dec 17, 2024

Motivation

Several additional suggestions were forgotten in the PR #3036

Proposal

The following corrections were made:

  • The ValueOrBytes is marked as private.
  • The count used for SetView, CollectionView, ReentrantCollectionView, MapView and KeyvalueStoreView are usize which makes them architecture dependent. We switch to u32.
  • The FnMut(I, V) forces a clone which is not always needed. So, it was replaced by FnMut(I, Cow<'a, V>). Actually, the clone still occurs, but if someone were to want to just access the reference, it would be possible.

Unfortunately, the use of the Cow complexifies the call to the for_each_key_value.

Test Plan

The CI.

Release Plan

This is a breaking change with TestNEt / DevNet as it changes the hashes values.

Links

None.

@MathieuDutSik MathieuDutSik requested a review from ma2bd December 17, 2024 15:04
@MathieuDutSik MathieuDutSik marked this pull request as ready for review December 19, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant