]> git.lizzy.rs Git - rust.git/commitdiff
option.get -> option.unwrap
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Sun, 28 Jul 2013 16:31:37 +0000 (09:31 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 7 Aug 2013 15:16:37 +0000 (08:16 -0700)
src/compiletest/runtest.rs
src/libextra/workcache.rs

index 5c1cc78d678f361f1525226fbcb8e1bf7f807f34..0d1c5c8eb43516c738c7df112f9c0fe5f48694c9 100644 (file)
@@ -162,9 +162,8 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
         round += 1;
     }
 
-    let mut expected =
-        match props.pp_exact {
-          Some(ref file) => {
+    let mut expected = match props.pp_exact {
+        Some(ref file) => {
             let filepath = testfile.dir_path().push_rel(file);
             io::read_whole_file_str(&filepath).unwrap()
           }
index 0256519abb7e835c257cd29943140cfdfa4aeb42..b4ba8acae476974cff76b27e2945718900e12350 100644 (file)
@@ -221,7 +221,7 @@ fn digest<T:Encodable<json::Encoder>>(t: &T) -> ~str {
 fn digest_file(path: &Path) -> ~str {
     let mut sha = ~Sha1::new();
     let s = io::read_whole_file_str(path);
-    (*sha).input_str(*s.get_ref());
+    (*sha).input_str(s.unwrap());
     (*sha).result_str()
 }
 
@@ -378,7 +378,7 @@ fn test() {
     let pth = Path("foo.c");
     {
         let r = io::file_writer(&pth, [io::Create]);
-        r.get_ref().write_str("int main() { return 0; }");
+        r.unwrap().write_str("int main() { return 0; }");
     }
 
     let cx = Context::new(RWArc::new(Database::new(Path("db.json"))),