Skip to content

Commit 3b441c4

Browse files
committed
Result::get -> Result::unwrap
1 parent e617651 commit 3b441c4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libextra/hex.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<'self> FromHex for &'self str {
7878
* fn main () {
7979
* let hello_str = "Hello, World".to_hex();
8080
* printfln!("%s", hello_str);
81-
* let bytes = hello_str.from_hex().get();
81+
* let bytes = hello_str.from_hex().unwrap();
8282
* printfln!("%?", bytes);
8383
* let result_str = str::from_bytes(bytes);
8484
* printfln!("%s", result_str);
@@ -132,9 +132,9 @@ mod tests {
132132
133133
#[test]
134134
pub fn test_from_hex_okay() {
135-
assert_eq!("666f6f626172".from_hex().get(),
135+
assert_eq!("666f6f626172".from_hex().unwrap(),
136136
"foobar".as_bytes().to_owned());
137-
assert_eq!("666F6F626172".from_hex().get(),
137+
assert_eq!("666F6F626172".from_hex().unwrap(),
138138
"foobar".as_bytes().to_owned());
139139
}
140140
@@ -151,7 +151,7 @@ mod tests {
151151
152152
#[test]
153153
pub fn test_from_hex_ignores_whitespace() {
154-
assert_eq!("666f 6f6\r\n26172 ".from_hex().get(),
154+
assert_eq!("666f 6f6\r\n26172 ".from_hex().unwrap(),
155155
"foobar".as_bytes().to_owned());
156156
}
157157
@@ -165,8 +165,8 @@ mod tests {
165165
#[test]
166166
pub fn test_from_hex_all_bytes() {
167167
for i in range(0, 256) {
168-
assert_eq!(fmt!("%02x", i as uint).from_hex().get(), ~[i as u8]);
169-
assert_eq!(fmt!("%02X", i as uint).from_hex().get(), ~[i as u8]);
168+
assert_eq!(fmt!("%02x", i as uint).from_hex().unwrap(), ~[i as u8]);
169+
assert_eq!(fmt!("%02X", i as uint).from_hex().unwrap(), ~[i as u8]);
170170
}
171171
}
172172

0 commit comments

Comments
 (0)