Add AsRef<[u8]> for String's Drain.
This commit is contained in:
parent
673284058b
commit
f5bb523e94
1 changed files with 7 additions and 0 deletions
|
@ -2488,6 +2488,13 @@ impl<'a> AsRef<str> for Drain<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "string_drain_as_str", issue = "none")]
|
||||||
|
impl<'a> AsRef<[u8]> for Drain<'a> {
|
||||||
|
fn as_ref(&self) -> &[u8] {
|
||||||
|
self.as_str().as_bytes()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "drain", since = "1.6.0")]
|
#[stable(feature = "drain", since = "1.6.0")]
|
||||||
impl Iterator for Drain<'_> {
|
impl Iterator for Drain<'_> {
|
||||||
type Item = char;
|
type Item = char;
|
||||||
|
|
Loading…
Reference in a new issue