mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -26,7 +26,8 @@ use std::borrow::{ToOwned, IntoCow};
|
|||
use std::boxed;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::old_io::{BufferedReader, File};
|
||||
use std::fs::File;
|
||||
use std::io::{BufReader, Read};
|
||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||
use std::thunk::Invoke;
|
||||
|
||||
|
@ -45,12 +46,13 @@ pub fn global_init() {
|
|||
};
|
||||
|
||||
let mut file = match File::open(&path) {
|
||||
Ok(f) => BufferedReader::new(f),
|
||||
Ok(f) => BufReader::new(f),
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
let lines = match file.read_to_string() {
|
||||
Ok(lines) => lines,
|
||||
let mut lines = String::new();
|
||||
match file.read_to_string(&mut lines) {
|
||||
Ok(()) => (),
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue