diff options
| author | Kevin Ballard <[email protected]> | 2013-05-10 20:22:14 -0700 |
|---|---|---|
| committer | Kevin Ballard <[email protected]> | 2013-05-10 20:22:14 -0700 |
| commit | 4e79896c962699e92e29bba97a07987cf26dec25 (patch) | |
| tree | ca62dd4c9f9ff1313c0412f744ad8fa62e5bb7b4 /hex.rs | |
| parent | Tweak for rust trunk (c081ffb 2013-04-30 02:21:37 -0700) (diff) | |
| download | rust-openssl-4e79896c962699e92e29bba97a07987cf26dec25.tar.xz rust-openssl-4e79896c962699e92e29bba97a07987cf26dec25.zip | |
Remove unnecessary `unsafe` blocks
Diffstat (limited to 'hex.rs')
| -rw-r--r-- | hex.rs | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -34,10 +34,8 @@ impl<'self> ToHex for &'self [u8] { let xhi = (x >> 4) & 0x0F; let xlo = (x ) & 0x0F; - unsafe { - str::push_char(&mut s, chars[xhi]); - str::push_char(&mut s, chars[xlo]); - } + str::push_char(&mut s, chars[xhi]); + str::push_char(&mut s, chars[xlo]); } s @@ -61,9 +59,7 @@ impl<'self> FromHex for &'self str { else { fail!(~"bad hex character"); }; if i % 2 == 0 { - unsafe { - vec::push(&mut vec, nibble << 4); - } + vec::push(&mut vec, nibble << 4); } else { vec[i/2] |= nibble; @@ -89,4 +85,4 @@ mod tests { } -}
\ No newline at end of file +} |