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

Consider changing MemoryDB::new to take no arguments #29

Open
expenses opened this issue Sep 25, 2019 · 0 comments
Open

Consider changing MemoryDB::new to take no arguments #29

expenses opened this issue Sep 25, 2019 · 0 comments

Comments

@expenses
Copy link

See paritytech/substrate#1427. MemoryDB is different from a lot of Rust storage types in that the new function takes an argument. I think it would make more sense for MemoryDB::new to construct an empty DB, alike, MemoryDB::default. A new from_data function could be added that replaces the old new function:

pub fn from_data(data: &'a [u8]) -> Self {
    Self::from_null_node(data, data.into())
}
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

No branches or pull requests

1 participant