From 2903e55de0fed9043dd5d8775cb2ce94b2dd47e3 Mon Sep 17 00:00:00 2001 From: Matt Murphy Date: Fri, 25 Apr 2014 08:52:29 -0500 Subject: [PATCH] ~[] to Vec in gfx/text/shaping/harfbuzz.rs --- src/components/gfx/text/glyph.rs | 10 +++++----- src/components/gfx/text/shaping/harfbuzz.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/gfx/text/glyph.rs b/src/components/gfx/text/glyph.rs index 2bb77f8a06b5..d0693045b80a 100644 --- a/src/components/gfx/text/glyph.rs +++ b/src/components/gfx/text/glyph.rs @@ -555,20 +555,20 @@ impl<'a> GlyphStore { self.entry_buffer[i] = entry; } - pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &[GlyphData]) { + pub fn add_glyphs_for_char_index(&mut self, i: uint, data_for_glyphs: &Vec) { assert!(i < self.entry_buffer.len()); assert!(data_for_glyphs.len() > 0); let glyph_count = data_for_glyphs.len(); - let first_glyph_data = data_for_glyphs[0]; + let first_glyph_data = data_for_glyphs.get(0); let entry = match first_glyph_data.is_missing { true => GlyphEntry::missing(glyph_count), false => { let glyphs_vec = slice::from_fn(glyph_count, |i| { - DetailedGlyph::new(data_for_glyphs[i].index, - data_for_glyphs[i].advance, - data_for_glyphs[i].offset) + DetailedGlyph::new(data_for_glyphs.get(i).index, + data_for_glyphs.get(i).advance, + data_for_glyphs.get(i).offset) }); self.detail_store.add_detailed_glyphs_for_entry(i, glyphs_vec); diff --git a/src/components/gfx/text/shaping/harfbuzz.rs b/src/components/gfx/text/shaping/harfbuzz.rs index 45423eedf5ac..31a3ee7881e0 100644 --- a/src/components/gfx/text/shaping/harfbuzz.rs +++ b/src/components/gfx/text/shaping/harfbuzz.rs @@ -411,7 +411,7 @@ impl Shaper { glyphs.add_glyph_for_char_index(char_idx, &data); } else { // collect all glyphs to be assigned to the first character. - let mut datas = ~[]; + let mut datas = Vec::new(); for glyph_i in glyph_span.eachi() { let shape = glyph_data.get_entry_for_glyph(glyph_i, &mut y_pos); @@ -425,7 +425,7 @@ impl Shaper { } // now add the detailed glyph entry. - glyphs.add_glyphs_for_char_index(char_idx, datas); + glyphs.add_glyphs_for_char_index(char_idx, &datas); // set the other chars, who have no glyphs let mut i = covered_byte_span.begin();