~[] to Vec in gfx/text/text_run.rs

This commit is contained in:
Matt Murphy 2014-04-26 09:14:01 -05:00 committed by Ms2ger
parent 2903e55de0
commit b88c84dde8

View file

@ -18,7 +18,7 @@ pub struct TextRun {
pub font_metrics: FontMetrics, pub font_metrics: FontMetrics,
pub font_style: FontStyle, pub font_style: FontStyle,
pub decoration: text_decoration::T, pub decoration: text_decoration::T,
pub glyphs: Arc<~[Arc<GlyphStore>]>, pub glyphs: Arc<Vec<Arc<GlyphStore>>>,
} }
pub struct SliceIterator<'a> { pub struct SliceIterator<'a> {
@ -113,10 +113,10 @@ impl<'a> TextRun {
pub fn teardown(&self) { pub fn teardown(&self) {
} }
pub fn break_and_shape(font: &mut Font, text: &str) -> ~[Arc<GlyphStore>] { pub fn break_and_shape(font: &mut Font, text: &str) -> Vec<Arc<GlyphStore>> {
// TODO(Issue #230): do a better job. See Gecko's LineBreaker. // TODO(Issue #230): do a better job. See Gecko's LineBreaker.
let mut glyphs = ~[]; let mut glyphs = Vec::new();
let mut byte_i = 0u; let mut byte_i = 0u;
let mut cur_slice_is_whitespace = false; let mut cur_slice_is_whitespace = false;
let mut byte_last_boundary = 0; let mut byte_last_boundary = 0;
@ -174,7 +174,7 @@ impl<'a> TextRun {
}) })
} }
pub fn glyphs(&'a self) -> &'a ~[Arc<GlyphStore>] { pub fn glyphs(&'a self) -> &'a Vec<Arc<GlyphStore>> {
&*self.glyphs &*self.glyphs
} }