Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upIndex access depreciated #713
Conversation
This comment has been minimized.
This comment has been minimized.
|
It should be possible to provide an impl of |
This comment has been minimized.
This comment has been minimized.
|
Ah, specifically I do not want the exact size to be exposed. This allows the iterator to skip or insert events during iteration. |
AndyGauge
reviewed
Aug 23, 2017
| @@ -1161,7 +1161,7 @@ impl Poll { | |||
| self.readiness_queue.poll(&mut events.inner); | |||
|
|
|||
| // Return number of polled events | |||
| Ok(events.len()) | |||
| Ok(events.iter().count()) | |||
This comment has been minimized.
This comment has been minimized.
AndyGauge
Aug 23, 2017
Author
Contributor
Should we not return the number of polled events since we do not know the exact number?
This comment has been minimized.
This comment has been minimized.
carllerche
Aug 23, 2017
Owner
Yeah, we should definitely not return the number... We have to leave it for now, but that return value should be deprecated.
This comment has been minimized.
This comment has been minimized.
AndyGauge
Aug 23, 2017
Author
Contributor
What about a 0 or 1? Return 0 for no events (like a timeout) and 1 if there is at least one?
This comment has been minimized.
This comment has been minimized.
carllerche
Aug 31, 2017
Owner
Yeah, I think some return value like that could be good, but it will have to be punted until 0.7. We can open an issue to track that change. The ret value today will have to stay the same :(
AndyGauge
added some commits
Sep 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks! Looks good. Would you mind also updating the documentation for |
This comment has been minimized.
This comment has been minimized.
|
Sure, once the tests finish I'll get that done. I meant to ask how to deprecate the return value! |
This comment has been minimized.
This comment has been minimized.
|
@AndyGauge I think it has to just be part of the fn docs as well as do a pass of the rest of the docs / tests to ensure it isn't being used. Maybe @alexcrichton has a better idea? |
This comment has been minimized.
This comment has been minimized.
|
Nah yeah there's no way I know of to deprecate just the return value, but you could temporarily switch it to a |
AndyGauge
added some commits
Sep 14, 2017
This comment has been minimized.
This comment has been minimized.
|
Found an example that needs to be reworked. Poll::deregister example (poll.rs#892)
Looking for high level guidance how this should be addressed. |
This comment has been minimized.
This comment has been minimized.
|
I think checking for zero right now is OK. It's the only way to test if |
This comment has been minimized.
This comment has been minimized.
|
That's why I wanted to bring it to your attention. We likely need to create a convenience for this case like |
This comment has been minimized.
This comment has been minimized.
|
Ah, so basically add a test fn on the |
This comment has been minimized.
This comment has been minimized.
|
Ok, I think the answer will be to add This PR is good as is, so I'll create a tracking issue for this. |
AndyGauge commentedAug 22, 2017
Fixes #697