Add AsRef<[u8]> for String's Drain.
This commit is contained in:
parent
673284058b
commit
f5bb523e94
@ -2488,6 +2488,13 @@ fn as_ref(&self) -> &str {
|
||||
}
|
||||
}
|
||||
|
||||
#[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")]
|
||||
impl Iterator for Drain<'_> {
|
||||
type Item = char;
|
||||
|
Loading…
Reference in New Issue
Block a user