about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/lib.rs4
-rw-r--r--src/librustc/metadata/decoder.rs12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index ef046419789..c5f7d61c224 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -241,8 +241,8 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
       1u => {
         let ifile = matches.free[0].as_slice();
         if ifile == "-" {
-            let src =
-                str::from_utf8_owned(io::stdin().read_to_end()).unwrap();
+            let contents = io::stdin().read_to_end().unwrap();
+            let src = str::from_utf8_owned(contents).unwrap();
             (d::StrInput(src), None)
         } else {
             (d::FileInput(Path::new(ifile)), Some(Path::new(ifile)))
diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs
index 824d0efff25..8ba98e84dfa 100644
--- a/src/librustc/metadata/decoder.rs
+++ b/src/librustc/metadata/decoder.rs
@@ -1160,12 +1160,12 @@ fn list_crate_deps(data: &[u8], out: &mut io::Writer) -> io::IoResult<()> {
     let r = get_crate_deps(data);
     for dep in r.iter() {
         let string = token::get_ident(dep.name.name);
-        write!(out,
-               "{} {}-{}-{}\n",
-               dep.cnum,
-               string.get(),
-               dep.hash,
-               dep.vers);
+        if_ok!(write!(out,
+                      "{} {}-{}-{}\n",
+                      dep.cnum,
+                      string.get(),
+                      dep.hash,
+                      dep.vers));
     }
 
     if_ok!(write!(out, "\n"));