1
Fork 0

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:
Alex Crichton 2015-03-26 16:54:15 -07:00
parent 199bdcfeff
commit e71221f327

View file

@ -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>>;