diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /vendor/gix-attributes/src/parse.rs | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-attributes/src/parse.rs')
-rw-r--r-- | vendor/gix-attributes/src/parse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Self::Item> { 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; |