Fix warnings in gfx.

This commit is contained in:
Ms2ger 2015-02-13 11:00:20 +01:00
parent 5e999c7d40
commit e25322ce5b
6 changed files with 24 additions and 12 deletions

View file

@ -345,7 +345,7 @@ impl<'a> DetailedGlyphStore {
// FIXME: Is this right? --pcwalton
// TODO: should fix this somewhere else
if count == 0 {
return self.detail_buffer.slice(0, 0);
return &self.detail_buffer[0..0];
}
assert!((count as uint) <= self.detail_buffer.len());
@ -361,7 +361,7 @@ impl<'a> DetailedGlyphStore {
assert!(i + (count as uint) <= self.detail_buffer.len());
// return a slice into the buffer
self.detail_buffer.slice(i, i + count as uint)
&self.detail_buffer[i .. i + count as uint]
}
fn get_detailed_glyph_with_index(&'a self,

View file

@ -231,7 +231,7 @@ impl<'a> TextRun {
// Create a glyph store for this slice if it's nonempty.
if can_break_before && byte_i > byte_last_boundary {
let slice = text.slice(byte_last_boundary, byte_i);
let slice = &text[byte_last_boundary .. byte_i];
debug!("creating glyph store for slice {} (ws? {}), {} - {} in run {}",
slice, !cur_slice_is_whitespace, byte_last_boundary, byte_i, text);
@ -254,7 +254,7 @@ impl<'a> TextRun {
// Create a glyph store for the final slice if it's nonempty.
if byte_i > byte_last_boundary {
let slice = text.slice_from(byte_last_boundary);
let slice = &text[byte_last_boundary..];
debug!("creating glyph store for final slice {} (ws? {}), {} - {} in run {}",
slice, cur_slice_is_whitespace, byte_last_boundary, text.len(), text);
@ -343,7 +343,7 @@ impl<'a> TextRun {
Some(index) => index,
};
NaturalWordSliceIterator {
glyph_iter: self.glyphs.slice_from(index).iter(),
glyph_iter: self.glyphs[index..].iter(),
range: *range,
}
}
@ -356,7 +356,7 @@ impl<'a> TextRun {
None => self.glyphs.len(),
Some(index) => index,
};
let mut glyph_run_iter = self.glyphs.slice_from(index).iter();
let mut glyph_run_iter = self.glyphs[index..].iter();
let first_glyph_run = glyph_run_iter.next();
CharacterSliceIterator {
glyph_run: first_glyph_run,