From 41396a6d1eb672115556c1ad94b247bb4efc0751 Mon Sep 17 00:00:00 2001 From: novafacing Date: Mon, 31 Jul 2023 16:39:28 -0700 Subject: [PATCH] Do not use is_some_and due to MSRV --- src/bindgen/ir/annotation.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bindgen/ir/annotation.rs b/src/bindgen/ir/annotation.rs index 50741c909..249507a65 100644 --- a/src/bindgen/ir/annotation.rs +++ b/src/bindgen/ir/annotation.rs @@ -101,7 +101,11 @@ impl AnnotationSet { .ok_or("Could not find suffix in line")?; let prefix = first_line[..suffix_index].to_string(); - while value_lines.last().is_some_and(|l| l.ends_with('\\')) { + while let Some(last) = value_lines.last() { + if !last.ends_with('\\') { + break; + } + i += 1; let s = &attrs_lines[i]; value_lines.push(s.to_string()); @@ -118,8 +122,10 @@ impl AnnotationSet { .trim_end() .to_string(); - if l.find(&prefix).is_some_and(|i| i == 0) { - l = l.replacen(&prefix, "", 1); + if let Some(line) = l.find(&prefix) { + if line == 0 { + l = l.replacen(&prefix, "", 1); + } } l