-
Notifications
You must be signed in to change notification settings - Fork 399
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
Convert Storage::entries
's max_size
argument to Option<u64>
#98
Comments
Maybe adding a comment is better. /cc @Hoverbear |
@bkchr Would adding a comment about this limit be satisfactory? Since |
Yeah I know that |
Perhaps |
Yeah, an option would also fit here ;) |
@bkchr Would you still be interested in making a PR, or is this open for others to tackle? |
Open for others :) |
Storage::entries
max_size
should be an Enum
Storage::entries
max_size
to Option<u64>
Storage::entries
max_size
to Option<u64>
Storage::entries
's max_size
argument to Option<u64>
Id like to work on this! |
dang, too slow :/ |
sorry @estk, I should have commented when I started working on it :-/ if you are so inclined, I'd love some code review of my PR! |
Sure thing @pwoolcoc, you're too quick on the draw :) |
@Hoverbear haha, you really gotta be quick here! Thanks for pointing that one out, but it looks like I'm too late again. I'll be away for the weekend but I'll swing back next week and try to pick up an issue. Thanks for the hospitality @Hoverbear |
🤦♀️ Ha, I'm sorry. :) |
…u64>` (#183) * Closes #98 * rustfmt pass * Treat `Some(NO_LIMIT)` the same as `None` * Address some review comments * Change signatures of both these `entries` methods to allow compatibility Changing the `max_size` parameter to an Option<u64> will break existing callers, so this commit changes max_size to be `Into<Option<u64>>` so existing callers will not need to change. It will, however, break implementers of the `Storage` trait, but I thought that was less common than calling the methods * address code review comments * Change `slice` to use `impl Into<Option<u64>>`
Currently the value is just a
u64
withu64::MAX
defined asNO_LIMIT
.This no limit is not mentioned in the documentation. Something like the following enum would suite better:
I could provide a PR, if wanted.
Edit (brson): per discussion, let's change this to
Option<u64>
with a doc-comment explaining thatNone
means "no limit". TheStorage
trait is insrc/storage.rs
.The text was updated successfully, but these errors were encountered: