mirror of
https://github.com/servo/servo.git
synced 2025-10-09 21:10:19 +01:00
~[] to Vec in net/resource_task.rs
This commit is contained in:
parent
631f70b1c5
commit
c174a40afd
2 changed files with 3 additions and 3 deletions
|
@ -96,12 +96,12 @@ pub fn start_sending(start_chan: Sender<LoadResponse>,
|
|||
|
||||
/// Convenience function for synchronously loading a whole resource.
|
||||
pub fn load_whole_resource(resource_task: &ResourceTask, url: Url)
|
||||
-> Result<(Metadata, ~[u8]), ()> {
|
||||
-> Result<(Metadata, Vec<u8>), ()> {
|
||||
let (start_chan, start_port) = channel();
|
||||
resource_task.send(Load(url, start_chan));
|
||||
let response = start_port.recv();
|
||||
|
||||
let mut buf = ~[];
|
||||
let mut buf = Vec::new();
|
||||
loop {
|
||||
match response.progress_port.recv() {
|
||||
Payload(data) => buf.push_all(data.as_slice()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue