diff options
| author | Florian Hahn <flo@fhahn.com> | 2013-09-25 22:58:57 +0200 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2013-09-25 22:58:57 +0200 |
| commit | 23a067dc2ce107054e34fb2d2ceda1549aa35245 (patch) | |
| tree | b8a15cc90cabfdb161d7e8c0d7dbcec0e5acac0f | |
| parent | 0186473bd2ec34a56496c7b513ee380cbf30a6a3 (diff) | |
| download | rust-23a067dc2ce107054e34fb2d2ceda1549aa35245.tar.gz rust-23a067dc2ce107054e34fb2d2ceda1549aa35245.zip | |
Rename from_utf8 to from_bytes again
| -rw-r--r-- | src/libextra/bitv.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 780527e4532..1ff54772f39 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -523,7 +523,7 @@ impl Bitv { * with the most significant bits of each byte coming first. Each * bit becomes true if equal to 1 or false if equal to 0. */ -pub fn from_utf8(bytes: &[u8]) -> Bitv { +pub fn from_bytes(bytes: &[u8]) -> Bitv { from_fn(bytes.len() * 8, |i| { let b = bytes[i / 8] as uint; let offset = i % 8; @@ -1275,8 +1275,8 @@ mod tests { } #[test] - fn test_from_utf8() { - let bitv = from_utf8([0b10110110, 0b00000000, 0b11111111]); + fn test_from_bytes() { + let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]); let str = ~"10110110" + "00000000" + "11111111"; assert_eq!(bitv.to_str(), str); } @@ -1302,7 +1302,7 @@ mod tests { #[test] fn test_to_bools() { let bools = ~[false, false, true, false, false, true, true, false]; - assert_eq!(from_utf8([0b00100110]).to_bools(), bools); + assert_eq!(from_bytes([0b00100110]).to_bools(), bools); } #[test] |
