about summary refs log tree commit diff
path: root/src/libextra/md4.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-06-11 13:10:37 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-06-12 12:21:04 +1000
commitefc71a8bdb28fba88d0cc8916b33838bf43b3a8d (patch)
treead0086d4319facd8da21583e19a952a01250bbbd /src/libextra/md4.rs
parentba4a4778cc17c64c33a891a0d2565a1fb04ddffc (diff)
downloadrust-efc71a8bdb28fba88d0cc8916b33838bf43b3a8d.tar.gz
rust-efc71a8bdb28fba88d0cc8916b33838bf43b3a8d.zip
std: unify the str -> [u8] functions as 3 methods: .as_bytes() and .as_bytes_with_null[_consume]().
The first acts on &str and is not nul-terminated, the last two act on strings
that are always null terminated (&'static str, ~str and @str).
Diffstat (limited to 'src/libextra/md4.rs')
-rw-r--r--src/libextra/md4.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs
index 01edbbe366d..94793804bb1 100644
--- a/src/libextra/md4.rs
+++ b/src/libextra/md4.rs
@@ -10,7 +10,6 @@
 
 use core::prelude::*;
 
-use core::str;
 use core::uint;
 use core::vec;
 
@@ -129,7 +128,7 @@ pub fn md4_str(msg: &[u8]) -> ~str {
 
 /// Calculates the md4 hash of a string, returning the hex-encoded version of
 /// the hash
-pub fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) }
+pub fn md4_text(msg: &str) -> ~str { md4_str(msg.as_bytes()) }
 
 #[test]
 fn test_md4() {