Skip to content

Commit

Permalink
build-manifest: Remove old to_hex function
Browse files Browse the repository at this point in the history
This was actually just generating invalid hashes for the `rust`
component.
  • Loading branch information
alexcrichton committed Feb 26, 2017
1 parent 476a1cc commit 5ed6765
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl Builder {
pkg.target.insert(host.to_string(), Target {
available: true,
url: Some(self.url("rust", host)),
hash: Some(to_hex(digest.as_ref())),
hash: Some(digest),
components: Some(components),
extensions: Some(extensions),
});
Expand Down Expand Up @@ -409,19 +409,3 @@ impl Builder {
self.sign(&dst);
}
}

fn to_hex(digest: &[u8]) -> String {
let mut ret = String::new();
for byte in digest {
ret.push(hex((byte & 0xf0) >> 4));
ret.push(hex(byte & 0xf));
}
return ret;

fn hex(b: u8) -> char {
match b {
0...9 => (b'0' + b) as char,
_ => (b'a' + b - 10) as char,
}
}
}

0 comments on commit 5ed6765

Please sign in to comment.