]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/theme.rs
Rollup merge of #60766 - vorner:weak-into-raw, r=sfackler
[rust.git] / src / librustdoc / theme.rs
index 55a11d1976599b5d562a6be085c8a96dd44d3055..7a0ccf6975f8c23fe0e00b73054d6d27d44978de 100644 (file)
@@ -1,17 +1,6 @@
-// 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;
@@ -278,12 +267,9 @@ pub fn get_differences(against: &CssPath, other: &CssPath, v: &mut Vec<String>)
 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)
 }