-// Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
use rustc_data_structures::fx::FxHashSet;
-use std::fs::File;
+use std::fs;
use std::hash::{Hash, Hasher};
-use std::io::Read;
use std::path::Path;
use errors::Handler;
pub fn test_theme_against<P: AsRef<Path>>(f: &P, against: &CssPath, diag: &Handler)
-> (bool, Vec<String>)
{
- let mut file = try_something!(File::open(f), diag, (false, Vec::new()));
- let mut data = Vec::with_capacity(1000);
-
- try_something!(file.read_to_end(&mut data), diag, (false, Vec::new()));
+ let data = try_something!(fs::read(f), diag, (false, vec![]));
let paths = load_css_paths(&data);
- let mut ret = Vec::new();
+ let mut ret = vec![];
get_differences(against, &paths, &mut ret);
(true, ret)
}