fix clippy

This commit is contained in:
stelzo 2025-02-20 23:07:20 +01:00
parent a8e94784b4
commit d3a3ddd1c4
No known key found for this signature in database
GPG Key ID: FC4EF89052319374
2 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ pub fn line<'a>(
let mut items = collect_items(engine, p, range, trim); let mut items = collect_items(engine, p, range, trim);
// Add a hyphen at the line start, if a previous dash should be repeated. // Add a hyphen at the line start, if a previous dash should be repeated.
if pred.map_or(false, |pred| should_repeat_hyphen(pred, full)) { if pred.is_some_and(|pred| should_repeat_hyphen(pred, full)) {
if let Some(shaped) = items.first_text_mut() { if let Some(shaped) = items.first_text_mut() {
shaped.prepend_hyphen(engine, p.config.fallback); shaped.prepend_hyphen(engine, p.config.fallback);
} }
@ -406,7 +406,7 @@ fn should_repeat_hyphen(pred_line: &Line, text: &str) -> bool {
// //
// See § 4.1.1.1.2.e on the "Ortografía de la lengua española" // See § 4.1.1.1.2.e on the "Ortografía de la lengua española"
// https://www.rae.es/ortografía/como-signo-de-división-de-palabras-a-final-de-línea // https://www.rae.es/ortografía/como-signo-de-división-de-palabras-a-final-de-línea
Lang::SPANISH => text.chars().next().map_or(false, |c| !c.is_uppercase()), Lang::SPANISH => text.chars().next().is_some_and(|c| !c.is_uppercase()),
_ => false, _ => false,
} }

View File

@ -161,7 +161,7 @@ impl<'a> Runner<'a> {
// Compare against reference output if available. // Compare against reference output if available.
// Test that is ok doesn't need to be updated. // Test that is ok doesn't need to be updated.
if ref_data.as_ref().map_or(false, |r| D::matches(&live, r)) { if ref_data.as_ref().is_ok_and(|r| D::matches(&live, r)) {
return; return;
} }