From a53597d24a6f1ca17dffe32014618d4d6faf84b1 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 28 Oct 2013 20:08:55 -0700 Subject: [PATCH 1/2] fmt! -> format! --- ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ast.rs b/ast.rs index 4e33823a..bf15eea5 100644 --- a/ast.rs +++ b/ast.rs @@ -121,7 +121,7 @@ pub enum ErrorReason { impl ToStr for SyntaxError { fn to_str(&self) -> ~str { - fmt!("%u:%u %?", self.location.line, self.location.column, self.reason) + format!("{:u}:{:u} {:?}", self.location.line, self.location.column, self.reason) } } From 0d39f843e46f7f260704e0dff966d9f6b6bd0300 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 30 Oct 2013 13:56:13 -0700 Subject: [PATCH 2/2] Upgrade Rust --- tests.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests.rs b/tests.rs index 080bccc2..abe92c91 100644 --- a/tests.rs +++ b/tests.rs @@ -2,7 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use std::{io, str, run, task}; +use std::{str, run, task}; +use std::rt::io; +use std::rt::io::Writer; use extra::{tempfile, json}; use extra::json::ToJson; @@ -10,9 +12,9 @@ use super::*; fn write_whole_file(path: &Path, data: &str) { - match io::file_writer(path, [io::Create]) { - Ok(writer) => writer.write_str(data), - Err(message) => fail!(message), + match io::file::open(path, io::Create, io::Write) { + Some(mut writer) => writer.write(data.as_bytes()), + None => fail!("could not open file"), } }