mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Replace most usage of std::old_io::File.
This commit is contained in:
parent
4eb26065ac
commit
32d1e31c90
6 changed files with 32 additions and 25 deletions
|
@ -7,7 +7,7 @@
|
|||
#![feature(collections)]
|
||||
#![feature(core)]
|
||||
#![feature(int_uint)]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(old_io))]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(io))]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(old_path))]
|
||||
#![feature(plugin)]
|
||||
#![feature(rustc_private)]
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::old_io as io;
|
||||
use std::old_io::File;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
/// Platform specific font representation for Linux.
|
||||
/// The identifier is an absolute path, and the bytes
|
||||
|
@ -23,8 +23,10 @@ impl FontTemplateData {
|
|||
},
|
||||
None => {
|
||||
// TODO: Handle file load failure!
|
||||
let mut file = File::open_mode(&Path::new(identifier), io::Open, io::Read).unwrap();
|
||||
file.read_to_end().unwrap()
|
||||
let mut file = File::open(identifier).unwrap();
|
||||
let mut buffer = vec![];
|
||||
file.read_to_end(&mut buffer).unwrap();
|
||||
buffer
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue