aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/text.rs')
-rw-r--r--components/layout/text.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/layout/text.rs b/components/layout/text.rs
index 4bfbcb66ca8..9930b389b62 100644
--- a/components/layout/text.rs
+++ b/components/layout/text.rs
@@ -27,7 +27,7 @@ use util::geometry::Au;
use util::linked_list::split_off_head;
use util::logical_geometry::{LogicalSize, WritingMode};
use util::range::{Range, RangeIndex};
-use util::smallvec::{SmallVec, SmallVec1};
+use util::smallvec::SmallVec1;
/// A stack-allocated object for scanning an inline flow into `TextRun`-containing `TextFragment`s.
pub struct TextRunScanner {
@@ -185,7 +185,7 @@ impl TextRunScanner {
};
// FIXME(https://github.com/rust-lang/rust/issues/23338)
- let mut font = fontgroup.fonts.get(0).borrow_mut();
+ let mut font = fontgroup.fonts[0].borrow_mut();
Arc::new(box TextRun::new(&mut *font, run_text, &options))
};
@@ -193,7 +193,7 @@ impl TextRunScanner {
debug!("TextRunScanner: pushing {} fragment(s)", self.clump.len());
for (logical_offset, old_fragment) in
mem::replace(&mut self.clump, LinkedList::new()).into_iter().enumerate() {
- let mut range = *new_ranges.get(logical_offset);
+ let mut range = new_ranges[logical_offset];
if range.is_empty() {
debug!("Elided an `SpecificFragmentInfo::UnscannedText` because it was \
zero-length after compression");
@@ -238,14 +238,14 @@ impl TextRunScanner {
let length = string.len();
let original = mem::replace(string, String::with_capacity(length));
for character in original.chars() {
- string.push(character.to_uppercase())
+ string.extend(character.to_uppercase())
}
}
text_transform::T::lowercase => {
let length = string.len();
let original = mem::replace(string, String::with_capacity(length));
for character in original.chars() {
- string.push(character.to_lowercase())
+ string.extend(character.to_lowercase())
}
}
text_transform::T::capitalize => {
@@ -258,7 +258,7 @@ impl TextRunScanner {
//
// http://dev.w3.org/csswg/css-text/#typographic-letter-unit
if capitalize_next_letter && character.is_alphabetic() {
- string.push(character.to_uppercase());
+ string.extend(character.to_uppercase());
capitalize_next_letter = false;
continue
}
@@ -308,7 +308,7 @@ pub fn font_metrics_for_style(font_context: &mut FontContext, font_style: Arc<Fo
-> FontMetrics {
let fontgroup = font_context.get_layout_font_group_for_style(font_style);
// FIXME(https://github.com/rust-lang/rust/issues/23338)
- let font = fontgroup.fonts.get(0).borrow();
+ let font = fontgroup.fonts[0].borrow();
font.metrics.clone()
}