~[] to Vec in net/resource_task.rs

This commit is contained in:
Matt Murphy 2014-04-27 20:40:20 -05:00 committed by Ms2ger
parent 631f70b1c5
commit c174a40afd
2 changed files with 3 additions and 3 deletions

View file

@ -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()),

View file

@ -140,7 +140,7 @@ fn js_script_listener(to_parent: Sender<HtmlDiscoveryMessage>,
}
Ok((metadata, bytes)) => {
result_vec.push(JSFile {
data: str::from_utf8(bytes).unwrap().to_owned(),
data: str::from_utf8(bytes.as_slice()).unwrap().to_owned(),
url: metadata.final_url,
});
}