@@ -78,7 +78,7 @@ impl<'self> FromHex for &'self str {
78
78
* fn main () {
79
79
* let hello_str = "Hello, World".to_hex();
80
80
* printfln!("%s", hello_str);
81
- * let bytes = hello_str.from_hex().get ();
81
+ * let bytes = hello_str.from_hex().unwrap ();
82
82
* printfln!("%?", bytes);
83
83
* let result_str = str::from_bytes(bytes);
84
84
* printfln!("%s", result_str);
@@ -132,9 +132,9 @@ mod tests {
132
132
133
133
#[test]
134
134
pub fn test_from_hex_okay() {
135
- assert_eq!(" 666 f6f626172".from_hex().get (),
135
+ assert_eq!(" 666 f6f626172".from_hex().unwrap (),
136
136
" foobar".as_bytes().to_owned());
137
- assert_eq!(" 666 F6F626172 ".from_hex().get (),
137
+ assert_eq!(" 666 F6F626172 ".from_hex().unwrap (),
138
138
" foobar".as_bytes().to_owned());
139
139
}
140
140
@@ -151,7 +151,7 @@ mod tests {
151
151
152
152
#[test]
153
153
pub fn test_from_hex_ignores_whitespace() {
154
- assert_eq!(" 666 f 6 f6\r \n 26172 ".from_hex().get (),
154
+ assert_eq!(" 666 f 6 f6\r \n 26172 ".from_hex().unwrap (),
155
155
" foobar".as_bytes().to_owned());
156
156
}
157
157
@@ -165,8 +165,8 @@ mod tests {
165
165
#[test]
166
166
pub fn test_from_hex_all_bytes() {
167
167
for i in range(0, 256) {
168
- assert_eq!(fmt!(" %02 x", i as uint).from_hex().get (), ~[i as u8]);
169
- assert_eq!(fmt!(" %02 X ", i as uint).from_hex().get (), ~[i as u8]);
168
+ assert_eq!(fmt!(" %02 x", i as uint).from_hex().unwrap (), ~[i as u8]);
169
+ assert_eq!(fmt!(" %02 X ", i as uint).from_hex().unwrap (), ~[i as u8]);
170
170
}
171
171
}
172
172
0 commit comments