libstd: Make ToBase64 take slices
This commit is contained in:
parent
0c2674f947
commit
7550e45930
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ trait ToBase64 {
|
||||||
fn to_base64() -> ~str;
|
fn to_base64() -> ~str;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ~[u8]: ToBase64 {
|
impl &[u8]: ToBase64 {
|
||||||
fn to_base64() -> ~str {
|
fn to_base64() -> ~str {
|
||||||
let chars = str::chars(
|
let chars = str::chars(
|
||||||
~"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
~"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||||
|
@ -57,7 +57,7 @@ impl ~[u8]: ToBase64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ~str: ToBase64 {
|
impl &str: ToBase64 {
|
||||||
fn to_base64() -> ~str {
|
fn to_base64() -> ~str {
|
||||||
str::to_bytes(self).to_base64()
|
str::to_bytes(self).to_base64()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue