mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Remove some as_slice calls.
This commit is contained in:
parent
4ee89363fb
commit
6a55ae06d7
34 changed files with 79 additions and 79 deletions
|
@ -119,7 +119,7 @@ impl<'a> Eq for ApplicableDeclarationsCacheQuery<'a> {}
|
|||
|
||||
impl<'a> PartialEq<ApplicableDeclarationsCacheEntry> for ApplicableDeclarationsCacheQuery<'a> {
|
||||
fn eq(&self, other: &ApplicableDeclarationsCacheEntry) -> bool {
|
||||
let other_as_query = ApplicableDeclarationsCacheQuery::new(other.declarations.as_slice());
|
||||
let other_as_query = ApplicableDeclarationsCacheQuery::new(&other.declarations);
|
||||
self.eq(&other_as_query)
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ impl StyleSharingCandidate {
|
|||
match (&self.class, element.get_attr(&ns!(""), &atom!("class"))) {
|
||||
(&None, Some(_)) | (&Some(_), None) => return false,
|
||||
(&Some(ref this_class), Some(element_class)) if
|
||||
element_class != this_class.as_slice() => {
|
||||
element_class != &**this_class => {
|
||||
return false
|
||||
}
|
||||
(&Some(_), Some(_)) | (&None, None) => {}
|
||||
|
|
|
@ -1506,7 +1506,7 @@ impl Fragment {
|
|||
}
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::UnscannedText(ref text_fragment_info) => {
|
||||
util::str::is_whitespace(text_fragment_info.text.as_slice())
|
||||
util::str::is_whitespace(&text_fragment_info.text)
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
|
|||
let mut temporary_counter = Counter::new();
|
||||
let counter = self.traversal
|
||||
.counters
|
||||
.get(counter_name.as_slice())
|
||||
.get(&*counter_name)
|
||||
.unwrap_or(&mut temporary_counter);
|
||||
new_info = counter.render(self.traversal.layout_context,
|
||||
fragment.node,
|
||||
|
@ -200,13 +200,13 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
|
|||
let mut temporary_counter = Counter::new();
|
||||
let counter = self.traversal
|
||||
.counters
|
||||
.get(counter_name.as_slice())
|
||||
.get(&*counter_name)
|
||||
.unwrap_or(&mut temporary_counter);
|
||||
new_info = counter.render(self.traversal.layout_context,
|
||||
fragment.node,
|
||||
fragment.style.clone(),
|
||||
counter_style,
|
||||
RenderingMode::All(separator.as_slice()));
|
||||
RenderingMode::All(&separator));
|
||||
}
|
||||
GeneratedContentInfo::ContentItem(ContentItem::OpenQuote) => {
|
||||
new_info = Some(render_text(self.traversal.layout_context,
|
||||
|
|
|
@ -1384,7 +1384,7 @@ impl Flow for InlineFlow {
|
|||
kid.assign_block_size_for_inorder_child_if_necessary(layout_context, thread_id);
|
||||
}
|
||||
|
||||
self.base.position.size.block = match self.lines.as_slice().last() {
|
||||
self.base.position.size.block = match self.lines.last() {
|
||||
Some(ref last_line) => last_line.bounds.start.b + last_line.bounds.size.block,
|
||||
None => Au(0),
|
||||
};
|
||||
|
|
|
@ -600,7 +600,7 @@ impl LayoutTask {
|
|||
|
||||
// TODO we don't really even need to load this if mq does not match
|
||||
let (metadata, iter) = load_bytes_iter(&self.resource_task, url);
|
||||
let protocol_encoding_label = metadata.charset.as_ref().map(|s| s.as_slice());
|
||||
let protocol_encoding_label = metadata.charset.as_ref().map(|s| &**s);
|
||||
let final_url = metadata.final_url;
|
||||
|
||||
let sheet = Stylesheet::from_bytes_iter(iter,
|
||||
|
|
|
@ -169,7 +169,7 @@ impl TableFlow {
|
|||
TableLayout::Auto => {
|
||||
computation.union_block(&TableFlow::update_automatic_column_inline_sizes(
|
||||
column_inline_sizes,
|
||||
row.cell_intrinsic_inline_sizes.as_slice()))
|
||||
&row.cell_intrinsic_inline_sizes))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ impl Flow for TableFlow {
|
|||
self.block_flow.base.flags.remove(IMPACTED_BY_RIGHT_FLOATS);
|
||||
|
||||
let info = ChildInlineSizeInfo {
|
||||
column_computed_inline_sizes: self.column_computed_inline_sizes.as_slice(),
|
||||
column_computed_inline_sizes: &self.column_computed_inline_sizes,
|
||||
spacing: spacing_per_cell,
|
||||
};
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(layout_context,
|
||||
|
|
|
@ -281,7 +281,7 @@ impl Flow for TableRowFlow {
|
|||
|
||||
// Push those inline sizes down to the cells.
|
||||
let info = ChildInlineSizeInfo {
|
||||
column_computed_inline_sizes: computed_inline_size_for_cells.as_slice(),
|
||||
column_computed_inline_sizes: &computed_inline_size_for_cells,
|
||||
spacing: self.spacing,
|
||||
};
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(layout_context,
|
||||
|
|
|
@ -111,7 +111,7 @@ impl Flow for TableRowGroupFlow {
|
|||
containing_block_inline_size);
|
||||
|
||||
let info = ChildInlineSizeInfo {
|
||||
column_computed_inline_sizes: self.column_computed_inline_sizes.as_slice(),
|
||||
column_computed_inline_sizes: &self.column_computed_inline_sizes,
|
||||
spacing: self.spacing,
|
||||
};
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(layout_context,
|
||||
|
|
|
@ -324,7 +324,7 @@ impl Flow for TableWrapperFlow {
|
|||
}
|
||||
Some(ref assigned_column_inline_sizes) => {
|
||||
let info = ChildInlineSizeInfo {
|
||||
column_computed_inline_sizes: assigned_column_inline_sizes.as_slice(),
|
||||
column_computed_inline_sizes: &assigned_column_inline_sizes,
|
||||
spacing: self.block_flow.fragment.style().get_inheritedtable().border_spacing,
|
||||
};
|
||||
self.block_flow
|
||||
|
|
|
@ -142,7 +142,7 @@ impl TextRunScanner {
|
|||
};
|
||||
|
||||
let old_length = CharIndex(run_text.chars().count() as isize);
|
||||
last_whitespace = util::transform_text(in_fragment.as_slice(),
|
||||
last_whitespace = util::transform_text(&in_fragment,
|
||||
compression,
|
||||
last_whitespace,
|
||||
&mut run_text);
|
||||
|
|
|
@ -254,7 +254,7 @@ impl<'ln> LayoutNode<'ln> {
|
|||
s.push_str(" ");
|
||||
}
|
||||
|
||||
s.push_str(self.debug_str().as_slice());
|
||||
s.push_str(&self.debug_str());
|
||||
println!("{}", s);
|
||||
|
||||
for kid in self.children() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue