From a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:19 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-attributes/src/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vendor/gix-attributes/src/parse.rs') diff --git a/vendor/gix-attributes/src/parse.rs b/vendor/gix-attributes/src/parse.rs index 0b70cb306..2d90a006d 100644 --- a/vendor/gix-attributes/src/parse.rs +++ b/vendor/gix-attributes/src/parse.rs @@ -59,7 +59,7 @@ impl<'a> Iter<'a> { } else if attr.first() == Some(&b'!') { (&attr[1..], StateRef::Unspecified) } else { - (attr, possibly_value.map(StateRef::from_bytes).unwrap_or(StateRef::Set)) + (attr, possibly_value.map_or(StateRef::Set, StateRef::from_bytes)) }; Ok(AssignmentRef::new(check_attr(attr)?, state)) } @@ -106,7 +106,7 @@ impl<'a> Iterator for Lines<'a> { fn next(&mut self) -> Option { fn skip_blanks(line: &BStr) -> &BStr { - line.find_not_byteset(BLANKS).map(|pos| &line[pos..]).unwrap_or(line) + line.find_not_byteset(BLANKS).map_or(line, |pos| &line[pos..]) } for line in self.lines.by_ref() { self.line_no += 1; -- cgit v1.2.3