std: Stabilize BufRead::split
Now that `<[_]>::split` is an inherent method, it will trump `BufRead::split` when `BufRead` is in scope, so there is no longer a conflict. As a result, calling `slice.split()` will probably always give you precisely what you want!
This commit is contained in:
parent
199bdcfeff
commit
e71221f327
1 changed files with 3 additions and 4 deletions
|
@ -609,8 +609,7 @@ pub trait BufRead: Read {
|
||||||
///
|
///
|
||||||
/// This function will yield errors whenever `read_until` would have also
|
/// This function will yield errors whenever `read_until` would have also
|
||||||
/// yielded an error.
|
/// yielded an error.
|
||||||
#[unstable(feature = "io", reason = "may be renamed to not conflict with \
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
SliceExt::split")]
|
|
||||||
fn split(self, byte: u8) -> Split<Self> where Self: Sized {
|
fn split(self, byte: u8) -> Split<Self> where Self: Sized {
|
||||||
Split { buf: self, delim: byte }
|
Split { buf: self, delim: byte }
|
||||||
}
|
}
|
||||||
|
@ -854,13 +853,13 @@ impl fmt::Display for CharsError {
|
||||||
/// particular byte.
|
/// particular byte.
|
||||||
///
|
///
|
||||||
/// See `BufReadExt::split` for more information.
|
/// See `BufReadExt::split` for more information.
|
||||||
#[unstable(feature = "io", reason = "awaiting stability of BufReadExt::split")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct Split<B> {
|
pub struct Split<B> {
|
||||||
buf: B,
|
buf: B,
|
||||||
delim: u8,
|
delim: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(feature = "io", reason = "awaiting stability of BufReadExt::split")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl<B: BufRead> Iterator for Split<B> {
|
impl<B: BufRead> Iterator for Split<B> {
|
||||||
type Item = Result<Vec<u8>>;
|
type Item = Result<Vec<u8>>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue