chore: Clippy compliance with latest nightly compiler

This commit is contained in:
David Wendt 2021-08-14 21:17:47 -04:00 committed by kmeisthax
parent 5dee7f163c
commit f37a06241a
2 changed files with 6 additions and 6 deletions

View File

@ -216,6 +216,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
/// The `final_line_of_para` parameter should be flagged if this the final /// The `final_line_of_para` parameter should be flagged if this the final
/// line in the paragraph or layout operation (e.g. it wasn't caused by an /// line in the paragraph or layout operation (e.g. it wasn't caused by an
/// automatic newline and no more text is to be expected). /// automatic newline and no more text is to be expected).
#[allow(clippy::or_fun_call)]
fn fixup_line( fn fixup_line(
&mut self, &mut self,
context: &mut UpdateContext<'_, 'gc, '_>, context: &mut UpdateContext<'_, 'gc, '_>,
@ -248,7 +249,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
box_count += 1; box_count += 1;
} }
let mut line_bounds = line_bounds.unwrap_or_else(Default::default); let mut line_bounds = line_bounds.unwrap_or(Default::default());
let left_adjustment = let left_adjustment =
Self::left_alignment_offset(&self.current_line_span, self.is_first_line); Self::left_alignment_offset(&self.current_line_span, self.is_first_line);
@ -533,6 +534,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
} }
/// Destroy the layout context, returning the newly constructed layout list. /// Destroy the layout context, returning the newly constructed layout list.
#[allow(clippy::or_fun_call)]
fn end_layout( fn end_layout(
mut self, mut self,
context: &mut UpdateContext<'_, 'gc, '_>, context: &mut UpdateContext<'_, 'gc, '_>,
@ -541,7 +543,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
( (
self.boxes, self.boxes,
self.exterior_bounds.unwrap_or_else(Default::default), self.exterior_bounds.unwrap_or(Default::default()),
) )
} }

View File

@ -1574,6 +1574,7 @@ impl FormatSpans {
/// a handful of presentational attributes in the HTML tree to generate /// a handful of presentational attributes in the HTML tree to generate
/// styling. There's also a `lower_from_css` that respects both /// styling. There's also a `lower_from_css` that respects both
/// presentational markup and CSS stylesheets. /// presentational markup and CSS stylesheets.
#[allow(clippy::or_fun_call)]
pub fn lower_from_html(&mut self, tree: XmlDocument<'_>) { pub fn lower_from_html(&mut self, tree: XmlDocument<'_>) {
let mut format_stack = vec![self.default_format.clone()]; let mut format_stack = vec![self.default_format.clone()];
let mut last_successful_format = None; let mut last_successful_format = None;
@ -1615,10 +1616,7 @@ impl FormatSpans {
.eq_ignore_ascii_case("br") => {} .eq_ignore_ascii_case("br") => {}
Step::In(node) => format_stack.push(TextFormat::from_presentational_markup( Step::In(node) => format_stack.push(TextFormat::from_presentational_markup(
node, node,
format_stack format_stack.last().cloned().unwrap_or(Default::default()),
.last()
.cloned()
.unwrap_or_else(Default::default),
)), )),
Step::Around(node) if node.is_text() => { Step::Around(node) if node.is_text() => {
self.replace_text( self.replace_text(