Simplify the LoadData creation in parse_html.

This commit is contained in:
Ms2ger 2014-12-06 11:47:34 +01:00
parent 5d0934d8ec
commit de318ae8f1

View file

@ -217,11 +217,14 @@ pub fn parse_html(page: &Page,
InputUrl(ref url) => { InputUrl(ref url) => {
// Wait for the LoadResponse so that the parser knows the final URL. // Wait for the LoadResponse so that the parser knows the final URL.
let (input_chan, input_port) = channel(); let (input_chan, input_port) = channel();
let mut load_data = LoadData::new(url.clone(), input_chan); resource_task.send(Load(LoadData {
load_data.headers = msg_load_data.headers; url: url.clone(),
load_data.method = msg_load_data.method; method: msg_load_data.method,
load_data.data = msg_load_data.data; headers: msg_load_data.headers,
resource_task.send(Load(load_data)); data: msg_load_data.data,
cors: None,
consumer: input_chan,
}));
let load_response = input_port.recv(); let load_response = input_port.recv();