Skip to content

Commit

Permalink
~[] to Vec in gfx/text/shaping/harfbuzz.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 f32d1f0 commit 2903e55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/gfx/text/glyph.rs
Expand Up @@ -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<GlyphData>) {
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);
Expand Down
4 changes: 2 additions & 2 deletions src/components/gfx/text/shaping/harfbuzz.rs
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit 2903e55

Please sign in to comment.