diff --git a/servo/components/canvas/canvas_paint_task.rs b/servo/components/canvas/canvas_paint_task.rs index 3a495620c03c..bf2c00f989d5 100644 --- a/servo/components/canvas/canvas_paint_task.rs +++ b/servo/components/canvas/canvas_paint_task.rs @@ -49,7 +49,7 @@ impl<'a> CanvasPaintTask<'a> { //copy the data to the destination vector for _ in 0..src_read_rect.size.height { let row = &src_data[src .. src + (4 * src_read_rect.size.width) as usize]; - image_data.push_all(row); + image_data.extend_from_slice(row); src += stride as usize; } @@ -707,7 +707,7 @@ fn crop_image(image_data: Vec, let mut src = (crop_rect.origin.y * stride + crop_rect.origin.x * 4) as usize; for _ in 0..crop_rect.size.height { let row = &image_data[src .. src + (4 * crop_rect.size.width) as usize]; - new_image_data.push_all(row); + new_image_data.extend_from_slice(row); src += stride as usize; } new_image_data diff --git a/servo/components/canvas/lib.rs b/servo/components/canvas/lib.rs index 7338fffc7783..cf865c2f1637 100644 --- a/servo/components/canvas/lib.rs +++ b/servo/components/canvas/lib.rs @@ -4,7 +4,6 @@ #![feature(nonzero)] #![feature(slice_bytes)] -#![feature(vec_push_all)] #![feature(plugin)] #![plugin(plugins)] diff --git a/servo/components/compositing/constellation.rs b/servo/components/compositing/constellation.rs index 01cd79ca6ef4..d7697fdde484 100644 --- a/servo/components/compositing/constellation.rs +++ b/servo/components/compositing/constellation.rs @@ -1433,9 +1433,9 @@ impl Constellation { let mut pipelines_to_close = vec!(); let frame = self.frame(frame_id); - pipelines_to_close.push_all(&frame.next); + pipelines_to_close.extend_from_slice(&frame.next); pipelines_to_close.push(frame.current); - pipelines_to_close.push_all(&frame.prev); + pipelines_to_close.extend_from_slice(&frame.prev); pipelines_to_close }; @@ -1462,7 +1462,7 @@ impl Constellation { let mut frames_to_close = vec!(); let pipeline = self.pipeline(pipeline_id); - frames_to_close.push_all(&pipeline.children); + frames_to_close.extend_from_slice(&pipeline.children); frames_to_close }; diff --git a/servo/components/compositing/lib.rs b/servo/components/compositing/lib.rs index b4c0e780051f..9d99e95548f6 100644 --- a/servo/components/compositing/lib.rs +++ b/servo/components/compositing/lib.rs @@ -7,7 +7,6 @@ #![feature(iter_cmp)] #![feature(plugin)] #![feature(slice_bytes)] -#![feature(vec_push_all)] #![feature(mpsc_select)] #![feature(plugin)] #![plugin(plugins)] diff --git a/servo/components/gfx/lib.rs b/servo/components/gfx/lib.rs index 9fdacc72d195..7bb2456a9cb6 100644 --- a/servo/components/gfx/lib.rs +++ b/servo/components/gfx/lib.rs @@ -15,7 +15,6 @@ #![feature(plugin)] #![feature(str_char)] #![feature(unique)] -#![feature(vec_push_all)] #![plugin(plugins)] #![plugin(serde_macros)] diff --git a/servo/components/gfx/text/glyph.rs b/servo/components/gfx/text/glyph.rs index 31a1c850d00e..fa250bd1ba6d 100644 --- a/servo/components/gfx/text/glyph.rs +++ b/servo/components/gfx/text/glyph.rs @@ -226,7 +226,7 @@ impl<'a> DetailedGlyphStore { */ self.detail_lookup.push(entry); - self.detail_buffer.push_all(glyphs); + self.detail_buffer.extend_from_slice(glyphs); self.lookup_is_sorted = false; } diff --git a/servo/components/net/image_cache_task.rs b/servo/components/net/image_cache_task.rs index 4ec3516d3b4c..b2acbcd74945 100644 --- a/servo/components/net/image_cache_task.rs +++ b/servo/components/net/image_cache_task.rs @@ -343,7 +343,7 @@ impl ImageCache { (ResponseAction::HeadersAvailable(_), _) => {} (ResponseAction::DataAvailable(data), _) => { let pending_load = self.pending_loads.get_by_key_mut(&msg.key).unwrap(); - pending_load.bytes.push_all(&data); + pending_load.bytes.extend_from_slice(&data); } (ResponseAction::ResponseComplete(result), key) => { match result { diff --git a/servo/components/net/lib.rs b/servo/components/net/lib.rs index b445727ef415..10bbe28ddf35 100644 --- a/servo/components/net/lib.rs +++ b/servo/components/net/lib.rs @@ -6,7 +6,6 @@ #![feature(fnbox)] #![feature(mpsc_select)] #![feature(plugin)] -#![feature(vec_push_all)] #![feature(plugin)] #![plugin(plugins)] diff --git a/servo/components/net_traits/lib.rs b/servo/components/net_traits/lib.rs index 5da54d7c241a..fbf1b5e810a4 100644 --- a/servo/components/net_traits/lib.rs +++ b/servo/components/net_traits/lib.rs @@ -8,7 +8,6 @@ #![feature(plugin)] #![feature(slice_patterns)] #![feature(step_by)] -#![feature(vec_push_all)] #![feature(custom_attribute)] #![plugin(serde_macros, plugins)] @@ -423,7 +422,7 @@ pub fn load_whole_resource(resource_task: &ResourceTask, url: Url, pipeline_id: let mut buf = vec!(); loop { match response.progress_port.recv().unwrap() { - ProgressMsg::Payload(data) => buf.push_all(&data), + ProgressMsg::Payload(data) => buf.extend_from_slice(&data), ProgressMsg::Done(Ok(())) => return Ok((response.metadata, buf)), ProgressMsg::Done(Err(e)) => return Err(e) } diff --git a/servo/components/script/dom/blob.rs b/servo/components/script/dom/blob.rs index 5e5c13516c4f..141516e333f4 100644 --- a/servo/components/script/dom/blob.rs +++ b/servo/components/script/dom/blob.rs @@ -140,7 +140,7 @@ impl BlobMethods for Blob { let start = relativeStart.to_usize().unwrap(); let end = (relativeStart + span).to_usize().unwrap(); let mut bytes: Vec = Vec::new(); - bytes.push_all(&vec[start..end]); + bytes.extend_from_slice(&vec[start..end]); Blob::new(global.r(), Some(bytes), &relativeContentType) } } diff --git a/servo/components/script/dom/xmlhttprequest.rs b/servo/components/script/dom/xmlhttprequest.rs index 5fb6ec6c34e3..49ee61ab4cbf 100644 --- a/servo/components/script/dom/xmlhttprequest.rs +++ b/servo/components/script/dom/xmlhttprequest.rs @@ -253,7 +253,7 @@ impl XMLHttpRequest { } fn data_available(&mut self, payload: Vec) { - self.buf.borrow_mut().push_all(&payload); + self.buf.borrow_mut().extend_from_slice(&payload); self.xhr.root().process_data_available(self.gen_id, self.buf.borrow().clone()); } @@ -403,8 +403,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest { Some(raw) => { debug!("SetRequestHeader: old value = {:?}", raw[0]); let mut buf = raw[0].clone(); - buf.push_all(b", "); - buf.push_all(&value); + buf.extend_from_slice(b", "); + buf.extend_from_slice(&value); debug!("SetRequestHeader: new value = {:?}", buf); value = ByteString::new(buf); }, @@ -530,8 +530,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest { fn join_raw(a: &str, b: &str) -> Vec { let len = a.len() + b.len(); let mut vec = Vec::with_capacity(len); - vec.push_all(a.as_bytes()); - vec.push_all(b.as_bytes()); + vec.extend_from_slice(a.as_bytes()); + vec.extend_from_slice(b.as_bytes()); vec } diff --git a/servo/components/script/lib.rs b/servo/components/script/lib.rs index a10a657522bb..cec53d69ae2a 100644 --- a/servo/components/script/lib.rs +++ b/servo/components/script/lib.rs @@ -22,7 +22,6 @@ #![feature(slice_patterns)] #![feature(str_utf16)] #![feature(unicode)] -#![feature(vec_push_all)] #![deny(unsafe_code)] #![allow(non_snake_case)] diff --git a/servo/components/script/textinput.rs b/servo/components/script/textinput.rs index b5bd64211274..5d533f0e4195 100644 --- a/servo/components/script/textinput.rs +++ b/servo/components/script/textinput.rs @@ -235,9 +235,9 @@ impl TextInput { insert_lines[last_insert_lines_index].push_str(suffix); let mut new_lines = vec!(); - new_lines.push_all(lines_prefix); - new_lines.push_all(&insert_lines); - new_lines.push_all(lines_suffix); + new_lines.extend_from_slice(lines_prefix); + new_lines.extend_from_slice(&insert_lines); + new_lines.extend_from_slice(lines_suffix); new_lines }; diff --git a/servo/components/style/animation.rs b/servo/components/style/animation.rs index a073c39ae731..42704700c4db 100644 --- a/servo/components/style/animation.rs +++ b/servo/components/style/animation.rs @@ -814,7 +814,7 @@ fn interpolate_transform_list(from_list: &[TransformOperation], } } else { // TODO(gw): Implement matrix decomposition and interpolation - result.push_all(from_list); + result.extend_from_slice(from_list); } TransformList(Some(result)) diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs index a6938cd7b47a..f9b2953d453f 100644 --- a/servo/components/style/lib.rs +++ b/servo/components/style/lib.rs @@ -9,7 +9,6 @@ #![feature(custom_attribute)] #![feature(custom_derive)] #![feature(plugin)] -#![feature(vec_push_all)] #![plugin(serde_macros)] #![plugin(serde_macros)] diff --git a/servo/components/style/stylesheets.rs b/servo/components/style/stylesheets.rs index cbf569f772e5..109f3bb85659 100644 --- a/servo/components/style/stylesheets.rs +++ b/servo/components/style/stylesheets.rs @@ -87,7 +87,7 @@ impl Stylesheet { let mut bytes = vec![]; // TODO: incremental decoding and tokenization/parsing for chunk in input { - bytes.push_all(&chunk) + bytes.extend_from_slice(&chunk) } Stylesheet::from_bytes(&bytes, base_url, protocol_encoding_label, environment_encoding, origin, error_reporter) diff --git a/servo/components/style/values.rs b/servo/components/style/values.rs index a475b86a3348..bca051682caf 100644 --- a/servo/components/style/values.rs +++ b/servo/components/style/values.rs @@ -628,7 +628,7 @@ pub mod specified { let mut simplified = Vec::new(); for product in &node.products { match try!(CalcLengthOrPercentage::simplify_product(product)) { - SimplifiedValueNode::Sum(box sum) => simplified.push_all(&sum.values), + SimplifiedValueNode::Sum(box sum) => simplified.extend_from_slice(&sum.values), val => simplified.push(val), } } @@ -681,7 +681,7 @@ pub mod specified { let mut simplified = Vec::new(); for ref node in ast.products { match try!(CalcLengthOrPercentage::simplify_product(node)) { - SimplifiedValueNode::Sum(sum) => simplified.push_all(&sum.values), + SimplifiedValueNode::Sum(sum) => simplified.extend_from_slice(&sum.values), value => simplified.push(value), } } @@ -751,7 +751,7 @@ pub mod specified { let mut simplified = Vec::new(); for ref node in ast.products { match try!(CalcLengthOrPercentage::simplify_product(node)) { - SimplifiedValueNode::Sum(sum) => simplified.push_all(&sum.values), + SimplifiedValueNode::Sum(sum) => simplified.extend_from_slice(&sum.values), value => simplified.push(value), } } @@ -778,7 +778,7 @@ pub mod specified { let mut simplified = Vec::new(); for ref node in ast.products { match try!(CalcLengthOrPercentage::simplify_product(node)) { - SimplifiedValueNode::Sum(sum) => simplified.push_all(&sum.values), + SimplifiedValueNode::Sum(sum) => simplified.extend_from_slice(&sum.values), value => simplified.push(value), } }