We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28467f5 commit 122c94dCopy full SHA for 122c94d
src/libstd/path/mod.rs
@@ -591,6 +591,23 @@ impl BytesContainer for CString {
591
}
592
593
594
+impl<'a> BytesContainer for str::MaybeOwned<'a> {
595
+ #[inline]
596
+ fn container_as_bytes<'b>(&'b self) -> &'b [u8] {
597
+ self.as_slice().as_bytes()
598
+ }
599
600
+ fn container_into_owned_bytes(self) -> ~[u8] {
601
+ self.into_owned().into_bytes()
602
603
604
+ fn container_as_str<'b>(&'b self) -> Option<&'b str> {
605
+ Some(self.as_slice())
606
607
608
+ fn is_str(_: Option<str::MaybeOwned>) -> bool { true }
609
+}
610
+
611
#[inline(always)]
612
fn contains_nul(v: &[u8]) -> bool {
613
v.iter().any(|&x| x == 0)
0 commit comments