提交 38ac809c 编写于 作者: B Brian Anderson

core: Add to_bytes method to StrSlice trait

上级 82f1b2cc
......@@ -2273,6 +2273,7 @@ pub trait StrSlice {
pure fn to_owned(&self) -> ~str;
pure fn to_managed(&self) -> @str;
pure fn char_at(&self, i: uint) -> char;
fn to_bytes(&self) -> ~[u8];
}
/// Extension methods for strings
......@@ -2416,6 +2417,8 @@ impl StrSlice for &self/str {
#[inline]
pure fn char_at(&self, i: uint) -> char { char_at(*self, i) }
fn to_bytes(&self) -> ~[u8] { to_bytes(*self) }
}
pub trait OwnedStr {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册