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 upBufReader/Writer extension methods: is_empty, buffer #45323
Comments
kennytm
added
C-feature-request
T-libs
labels
Oct 16, 2017
bors
added a commit
that referenced
this issue
Nov 6, 2017
This comment has been minimized.
This comment has been minimized.
kennytm
added
C-tracking-issue
and removed
C-feature-request
labels
Nov 7, 2017
This comment has been minimized.
This comment has been minimized.
|
What's left for this to stabilize? I'm parsing bytes from a |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This is the tracking issue for: impl<R: Read> BufReader<R> {
pub fn is_empty(&self) -> bool { /*…*/ }
}Looks good to me to stabilize. @rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 17, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
added
the
proposed-final-comment-period
label
Mar 17, 2018
This comment has been minimized.
This comment has been minimized.
|
This seems fine to stabilize, but it seems like it'd be more useful to know how many bytes are buffered, rather than just that there are some number of bytes. |
This comment has been minimized.
This comment has been minimized.
|
Why not both? Slices have |
This comment has been minimized.
This comment has been minimized.
|
For sure. Would it be reasonable to try to squeeze that into this stabilization? |
This comment has been minimized.
This comment has been minimized.
|
Sounds ok to me, though we should probably (re)start FCP after the implementation is merged. |
This comment has been minimized.
This comment has been minimized.
|
Naming wise, I don't think |
This comment has been minimized.
This comment has been minimized.
|
Agreed. Sounds good to me. |
This comment has been minimized.
This comment has been minimized.
|
Alternatively, we could add |
This comment has been minimized.
This comment has been minimized.
|
#49139 adds |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 19, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Mar 19, 2018
This comment has been minimized.
This comment has been minimized.
|
With @sfackler's alternative (and IMO better) proposal just introduced, should this still be going into its final comment period? |
This comment has been minimized.
This comment has been minimized.
|
@rfcbot fcp cancel Let’s start again after |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 19, 2018
|
@SimonSapin proposal cancelled. |
rfcbot
removed
the
final-comment-period
label
Mar 19, 2018
This comment has been minimized.
This comment has been minimized.
|
We should likely also add a |
This comment has been minimized.
This comment has been minimized.
|
That can't be done backwards compatibly. |
This comment has been minimized.
This comment has been minimized.
|
@sfackler why not? It's just a |
This comment has been minimized.
This comment has been minimized.
|
Oh derp I somehow read that as |
This comment has been minimized.
This comment has been minimized.
|
Haha, no worries. Is there even a |
This comment has been minimized.
This comment has been minimized.
|
No there isn't >_> Off of the topic of me needing more caffeine, it definitely seems reasonable to add |
Mark-Simulacrum
changed the title
BufReader should have an is_empty() method
BufReader/Writer extension methods: is_empty, buffer
Jun 2, 2018
This comment has been minimized.
This comment has been minimized.
|
It has been a while since |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Wait, we aren't proposing to stabilize the (already deprecated) is_empty method are we? |
This comment has been minimized.
This comment has been minimized.
|
No, sorry I didn’t clarify. An API marked both unstable and deprecated is to be removed (after something like a couple release cycles of deprecation period, which we’re at in this case). |
This comment has been minimized.
This comment has been minimized.
|
I'm excited to see that this is so close to landing. Is this still waiting on an implementation of |
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Nov 14, 2018
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this issue
Nov 15, 2018
This comment has been minimized.
This comment has been minimized.
|
Bump. Is there anything else blocking stabilization? |
dtolnay
referenced this issue
Feb 23, 2019
Merged
Relax Read bounds on a bunch of BufReader<R> methods #58423
This comment has been minimized.
This comment has been minimized.
|
Is there any particular reason not to add |
This comment has been minimized.
This comment has been minimized.
|
Yeah, this has been a while. @SimonSapin @sfackler is this ready for a vote to stabilize? |
fintelia commentedOct 16, 2017
•
edited by SimonSapin
Update: this is the tracking issue for:
is_emptyis both unstable and deprecated, it should be removed.There is currently no way to tell whether there is any data buffered inside a BufReader. This is unfortunate because it means that an application has no way to know whether calls to read() and fill_buffer() will return instantly or trigger a potentially expensive call to the underlying Reader. I propose adding an is_empty() method to BufReader to fill this gap.