From 905cce2b7fd3b1d360ef65453084b3ab9d68f69a Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:42:49 -0500 Subject: [PATCH] Accept arg to or_else closures --- src/renderer/html_handlebars/hbs_renderer.rs | 4 +++- src/renderer/html_handlebars/helpers/fontawesome.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 4503d31dba..48e7f70574 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -868,7 +868,9 @@ fn convert_fontawesome(html: &str) -> String { if icon.is_empty() { text.to_owned() - } else if let Ok(svg) = fa::svg(type_, &icon).or_else(|| fa::svg(fa::Type::Brands, &icon)) { + } else if let Ok(svg) = + fa::svg(type_, &icon).or_else(|_| fa::svg(fa::Type::Brands, &icon)) + { format!( r#"{svg}"#, before = before, diff --git a/src/renderer/html_handlebars/helpers/fontawesome.rs b/src/renderer/html_handlebars/helpers/fontawesome.rs index 37f4eb83ec..16a78461ed 100644 --- a/src/renderer/html_handlebars/helpers/fontawesome.rs +++ b/src/renderer/html_handlebars/helpers/fontawesome.rs @@ -45,7 +45,7 @@ pub fn fa_helper( } out.write( fa::svg(type_, name) - .or_else(|| fa::svg(fa::Type::Brands, name)) + .or_else(|_| fa::svg(fa::Type::Brands, name)) .map_err(|_| RenderErrorReason::Other(format!("Missing font {}", name)))?, )?; out.write("")?;