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

Strip metadata fix #1774

Merged
merged 20 commits into from
Oct 21, 2024
Merged
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ hashbrown = { workspace = true }
bitvec = { workspace = true, features = ["alloc"] }
criterion = { workspace = true }
scale-info = { workspace = true, features = ["bit-vec"] }
assert_matches = { workspace = true }

[lib]
# Without this, libtest cli opts interfere with criteron benches:
Expand Down
8 changes: 8 additions & 0 deletions metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ impl StorageMetadata {
self.entries.values()
}

/// filter over the storage entries.
pkhry marked this conversation as resolved.
Show resolved Hide resolved
pub fn retain_entries<F>(&mut self, f: F)
pkhry marked this conversation as resolved.
Show resolved Hide resolved
where
F: FnMut(&StorageEntryMetadata) -> bool,
{
self.entries.retain(f)
}

/// Return a specific storage entry given its name.
pub fn entry_by_name(&self, name: &str) -> Option<&StorageEntryMetadata> {
self.entries.get_by_key(name)
Expand Down
Loading
Loading