-
Notifications
You must be signed in to change notification settings - Fork 27
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
The inconsistency of init
APIs
#221
Comments
Is there a specific concern that you have or is it mostly about consistency/uniformity of the APIs? |
The (not very good reason) this inconsistency exists is because these structures were written by different authors. The current thinking is to update them to all not return a |
It's not a usage issue. For me, it's just a convention or a habit to make the high-level APIs consistent. :) |
If it's not recoverable or doesn't expect the users to handle the error, then not returning a Result is a better option IMO. |
The
init
APIs ofStableBTreeMap
andStableVec
returns inconsistent results:StableBTreeMap::init
returnsStableBTreeMap
StableVec::init
returnsResult<StableVec, InitError>
Actually
MinHeap
also returns aResult
.Looks like
StableVec
uses thesafe_write
method which returns aResult
.Should
StableBTreeMap::init
do the same thing and return aResult
?The text was updated successfully, but these errors were encountered: