Skip to content

Commit

Permalink
Rename from_utf8 to from_bytes again
Browse files Browse the repository at this point in the history
  • Loading branch information
fhahn committed Sep 25, 2013
1 parent 0186473 commit 23a067d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libextra/bitv.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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]
Expand Down

5 comments on commit 23a067d

@bors
Copy link
Contributor

@bors bors commented on 23a067d Sep 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at fhahn@23a067d

@bors
Copy link
Contributor

@bors bors commented on 23a067d Sep 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging fhahn/rust/rename-str_from_bytes-fix = 23a067d into auto

@bors
Copy link
Contributor

@bors bors commented on 23a067d Sep 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fhahn/rust/rename-str_from_bytes-fix = 23a067d merged ok, testing candidate = 0022f2b

@bors
Copy link
Contributor

@bors bors commented on 23a067d Sep 26, 2013

@bors
Copy link
Contributor

@bors bors commented on 23a067d Sep 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 0022f2b

Please sign in to comment.