aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-08-19 16:42:03 +0200
committerMs2ger <ms2ger@gmail.com>2014-08-19 16:42:03 +0200
commit5c3b8f99d185671567ee5493fd0f5efa55ffaf27 (patch)
treed1dbfb83ee1926ea9504487d89ffcaeebdf57844 /src
parent30c66debb05cfc84cb8b0d53b6b174ce0af10879 (diff)
downloadservo-5c3b8f99d185671567ee5493fd0f5efa55ffaf27.tar.gz
servo-5c3b8f99d185671567ee5493fd0f5efa55ffaf27.zip
Cleanup the File::open_mode call.
Diffstat (limited to 'src')
-rw-r--r--src/test/harness/reftest/reftest.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/test/harness/reftest/reftest.rs b/src/test/harness/reftest/reftest.rs
index b074b4e75d3..fedfd487f97 100644
--- a/src/test/harness/reftest/reftest.rs
+++ b/src/test/harness/reftest/reftest.rs
@@ -93,13 +93,9 @@ fn parse_lists(file: &String, servo_args: &[String], render_mode: RenderMode) ->
let mut tests = Vec::new();
let mut next_id = 0;
let file_path = Path::new(file.clone());
- let contents: String = match File::open_mode(&file_path, io::Open, io::Read)
- .and_then(|mut f| {
- f.read_to_string()
- }) {
- Ok(s) => s,
- _ => fail!("Could not read file"),
- };
+ let contents = File::open_mode(&file_path, io::Open, io::Read)
+ .and_then(|mut f| f.read_to_string())
+ .ok().expect("Could not read file");
for line in contents.as_slice().lines() {
// ignore comments or empty lines