Replace most usage of std::old_io::File.

This commit is contained in:
Ms2ger 2015-03-20 21:32:08 +01:00
parent 4eb26065ac
commit 32d1e31c90
6 changed files with 32 additions and 25 deletions

View file

@ -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)]

View file

@ -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
},
};