Use chars().count() rather than char_len().

The latter is obsolete in current Rust.
This commit is contained in:
Ms2ger 2015-01-22 13:49:10 +01:00
parent faefb27f3e
commit 024571dfa3
5 changed files with 9 additions and 9 deletions

View file

@ -157,7 +157,7 @@ impl Font {
Some(glyphs) => return (*glyphs).clone(),
}
let mut glyphs = GlyphStore::new(text.char_len() as int,
let mut glyphs = GlyphStore::new(text.chars().count() as int,
options.flags.contains(IS_WHITESPACE_SHAPING_FLAG));
shaper.as_ref().unwrap().shape_text(text, options, &mut glyphs);

View file

@ -274,7 +274,7 @@ impl Shaper {
let glyph_data = ShapedGlyphData::new(buffer);
let glyph_count = glyph_data.len();
let byte_max = text.len() as int;
let char_max = text.char_len() as int;
let char_max = text.chars().count() as int;
// GlyphStore records are indexed by character, not byte offset.
// so, we must be careful to increment this when saving glyph entries.