summaryrefslogtreecommitdiffstats
path: root/vendor/gix-revision/src/spec/parse
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-revision/src/spec/parse
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-revision/src/spec/parse')
-rw-r--r--vendor/gix-revision/src/spec/parse/function.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/vendor/gix-revision/src/spec/parse/function.rs b/vendor/gix-revision/src/spec/parse/function.rs
index 94fb4ee5d..8a89f8f68 100644
--- a/vendor/gix-revision/src/spec/parse/function.rs
+++ b/vendor/gix-revision/src/spec/parse/function.rs
@@ -213,7 +213,7 @@ fn long_describe_prefix(name: &BStr) -> Option<(&BStr, delegate::PrefixHint<'_>)
.and_then(|generation| {
iter.next().map(|token| {
let last_token_len = token.len();
- let first_token_ptr = iter.last().map(|token| token.as_ptr()).unwrap_or(token.as_ptr());
+ let first_token_ptr = iter.last().map_or(token.as_ptr(), |token| token.as_ptr());
// SAFETY: both pointers are definitely part of the same object
#[allow(unsafe_code)]
let prior_tokens_len: usize = unsafe { token.as_ptr().offset_from(first_token_ptr) }
@@ -413,7 +413,7 @@ where
input = {
if let Some(b'@') = sep {
- let past_sep = input[sep_pos.map(|pos| pos + 1).unwrap_or(input.len())..].as_bstr();
+ let past_sep = input[sep_pos.map_or(input.len(), |pos| pos + 1)..].as_bstr();
let (nav, rest, _consumed) = parens(past_sep)?.ok_or_else(|| Error::AtNeedsCurlyBrackets {
input: input[sep_pos.unwrap_or(input.len())..].into(),
})?;