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

Provide helper methods for MemDb data #16

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

m1stoyanov
Copy link
Contributor

Motivation

Currently, I can't find an easy way to access data in the SharedBackend MemDb. Since its 'cache' field is private (which is likely appropriate), additional methods will be needed.

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense, but we can remove the result, because these are infallible

src/backend.rs Outdated
@@ -724,6 +724,40 @@ impl SharedBackend {
pub fn flush_cache_to(&self, cache_path: &Path) {
self.cache.0.flush_to(cache_path);
}

/// Returns the DB
pub fn data(&self) -> DatabaseResult<Arc<MemDb>> {
Copy link
Member

Choose a reason for hiding this comment

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

looks like we don't need the result on any of these functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@mattsse mattsse merged commit e479c92 into foundry-rs:main Jul 29, 2024
16 checks passed
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.

2 participants