Skip to content

Commit 6789568

Browse files
committed
---
yaml --- r: 60791 b: refs/heads/auto c: b1e7d49 h: refs/heads/master i: 60789: a5bb04d 60787: 6990fa5 60783: d18a782 v: v3
1 parent 9bd467e commit 6789568

File tree

3 files changed

+85
-135
lines changed

3 files changed

+85
-135
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: c8c60f063fafd4d41cd7d162794dca7018f7cd8a
17+
refs/heads/auto: b1e7d49b11a51fb3d6b41c0ec677d0d40e1d2c26
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libextra/base64.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub trait FromBase64 {
113113
fn from_base64(&self) -> ~[u8];
114114
}
115115

116-
impl FromBase64 for ~[u8] {
116+
impl<'self> FromBase64 for &'self [u8] {
117117
/**
118118
* Convert base64 `u8` vector into u8 byte values.
119119
* Every 4 encoded characters is converted into 3 octets, modulo padding.
@@ -188,7 +188,7 @@ impl FromBase64 for ~[u8] {
188188
}
189189
}
190190

191-
impl FromBase64 for ~str {
191+
impl<'self> FromBase64 for &'self str {
192192
/**
193193
* Convert any base64 encoded string (literal, `@`, `&`, or `~`)
194194
* to the byte values it encodes.
@@ -227,23 +227,23 @@ mod tests {
227227

228228
#[test]
229229
fn test_to_base64() {
230-
assert_eq!((~"").to_base64(), ~"");
231-
assert!((~"f").to_base64() == ~"Zg==");
232-
assert_eq!((~"fo").to_base64(), ~"Zm8=");
233-
assert_eq!((~"foo").to_base64(), ~"Zm9v");
234-
assert!((~"foob").to_base64() == ~"Zm9vYg==");
235-
assert_eq!((~"fooba").to_base64(), ~"Zm9vYmE=");
236-
assert_eq!((~"foobar").to_base64(), ~"Zm9vYmFy");
230+
assert_eq!("".to_base64(), ~"");
231+
assert_eq!("f".to_base64(), ~"Zg==");
232+
assert_eq!("fo".to_base64(), ~"Zm8=");
233+
assert_eq!("foo".to_base64(), ~"Zm9v");
234+
assert_eq!("foob".to_base64(), ~"Zm9vYg==");
235+
assert_eq!("fooba".to_base64(), ~"Zm9vYmE=");
236+
assert_eq!("foobar".to_base64(), ~"Zm9vYmFy");
237237
}
238238

239239
#[test]
240240
fn test_from_base64() {
241-
assert_eq!((~"").from_base64(), str::to_bytes(""));
242-
assert!((~"Zg==").from_base64() == str::to_bytes("f"));
243-
assert_eq!((~"Zm8=").from_base64(), str::to_bytes("fo"));
244-
assert_eq!((~"Zm9v").from_base64(), str::to_bytes("foo"));
245-
assert!((~"Zm9vYg==").from_base64() == str::to_bytes("foob"));
246-
assert_eq!((~"Zm9vYmE=").from_base64(), str::to_bytes("fooba"))
247-
assert_eq!((~"Zm9vYmFy").from_base64(), str::to_bytes("foobar"));
241+
assert_eq!("".from_base64(), str::to_bytes(""));
242+
assert_eq!("Zg==".from_base64(), str::to_bytes("f"));
243+
assert_eq!("Zm8=".from_base64(), str::to_bytes("fo"));
244+
assert_eq!("Zm9v".from_base64(), str::to_bytes("foo"));
245+
assert_eq!("Zm9vYg==".from_base64(), str::to_bytes("foob"));
246+
assert_eq!("Zm9vYmE=".from_base64(), str::to_bytes("fooba"))
247+
assert_eq!("Zm9vYmFy".from_base64(), str::to_bytes("foobar"));
248248
}
249249
}

0 commit comments

Comments
 (0)