mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
This commit is contained in:
parent
ff8cbff810
commit
95fc29fa0d
255 changed files with 3550 additions and 3362 deletions
|
@ -8,6 +8,7 @@ use resource_task::ProgressMsg::{Payload, Done};
|
|||
use std::borrow::ToOwned;
|
||||
use std::io;
|
||||
use std::io::File;
|
||||
use std::sync::mpsc::Sender;
|
||||
use servo_util::task::spawn_named;
|
||||
|
||||
static READ_SIZE: uint = 8192;
|
||||
|
@ -17,11 +18,11 @@ fn read_all(reader: &mut io::Stream, progress_chan: &Sender<ProgressMsg>)
|
|||
loop {
|
||||
let mut buf = vec!();
|
||||
match reader.push_at_least(READ_SIZE, READ_SIZE, &mut buf) {
|
||||
Ok(_) => progress_chan.send(Payload(buf)),
|
||||
Ok(_) => progress_chan.send(Payload(buf)).unwrap(),
|
||||
Err(e) => match e.kind {
|
||||
io::EndOfFile => {
|
||||
if buf.len() > 0 {
|
||||
progress_chan.send(Payload(buf));
|
||||
progress_chan.send(Payload(buf)).unwrap();
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
@ -39,7 +40,7 @@ pub fn factory(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
|
|||
eventual_consumer: load_data.consumer,
|
||||
};
|
||||
let progress_chan = start_sending(senders, Metadata::default(url.clone()));
|
||||
spawn_named("file_loader".to_owned(), proc() {
|
||||
spawn_named("file_loader".to_owned(), move || {
|
||||
let file_path: Result<Path, ()> = url.to_file_path();
|
||||
match file_path {
|
||||
Ok(file_path) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue