Skip to content

Commit

Permalink
~[] to Vec in net/resource_task.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
murphm8 authored and Ms2ger committed May 4, 2014
1 parent 631f70b commit c174a40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/net/resource_task.rs
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -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,
});
}
Expand Down

0 comments on commit c174a40

Please sign in to comment.