1
Fork 0

libstd: Make ToBase64 take slices

This commit is contained in:
Patrick Walton 2012-09-03 22:41:10 -07:00
parent 0c2674f947
commit 7550e45930

View file

@ -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()
} }