diff options
Diffstat (limited to 'vendor/gix-revision/src')
-rw-r--r-- | vendor/gix-revision/src/describe.rs | 11 | ||||
-rw-r--r-- | vendor/gix-revision/src/lib.rs | 5 | ||||
-rw-r--r-- | vendor/gix-revision/src/spec/parse/function.rs | 10 |
3 files changed, 17 insertions, 9 deletions
diff --git a/vendor/gix-revision/src/describe.rs b/vendor/gix-revision/src/describe.rs index 2c1636477..a931f23e0 100644 --- a/vendor/gix-revision/src/describe.rs +++ b/vendor/gix-revision/src/describe.rs @@ -168,6 +168,13 @@ pub(crate) mod function { first_parent, }: Options<'name>, ) -> Result<Option<Outcome<'name>>, Error> { + let _span = gix_trace::coarse!( + "gix_revision::describe()", + commit = %commit, + name_count = name_by_oid.len(), + max_candidates, + first_parent + ); max_candidates = max_candidates.min(MAX_CANDIDATES); if let Some(name) = name_by_oid.get(commit) { return Ok(Some(Outcome { @@ -306,11 +313,11 @@ pub(crate) mod function { graph .insert_parents( &commit, - |parent_id, parent_commit_date| { + &mut |parent_id, parent_commit_date| { queue.insert(parent_commit_date as u32, parent_id); commit_flags }, - |_parent_id, flags| *flags |= commit_flags, + &mut |_parent_id, flags| *flags |= commit_flags, first_parent, ) .map_err(|err| Error::InsertParentsToGraph { err, oid: commit })?; diff --git a/vendor/gix-revision/src/lib.rs b/vendor/gix-revision/src/lib.rs index 31d22768c..8929c0204 100644 --- a/vendor/gix-revision/src/lib.rs +++ b/vendor/gix-revision/src/lib.rs @@ -9,11 +9,12 @@ #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// +#[cfg(feature = "describe")] pub mod describe; +#[cfg(feature = "describe")] pub use describe::function::describe; /// pub mod spec; -pub use spec::types::Spec; - pub use gix_revwalk::{graph, Graph, PriorityQueue}; +pub use spec::types::Spec; diff --git a/vendor/gix-revision/src/spec/parse/function.rs b/vendor/gix-revision/src/spec/parse/function.rs index 8a89f8f68..05802d613 100644 --- a/vendor/gix-revision/src/spec/parse/function.rs +++ b/vendor/gix-revision/src/spec/parse/function.rs @@ -203,7 +203,7 @@ fn long_describe_prefix(name: &BStr) -> Option<(&BStr, delegate::PrefixHint<'_>) return None; }; let rest = substr.get(1..)?; - rest.iter().all(|b| b.is_ascii_hexdigit()).then(|| rest.as_bstr()) + rest.iter().all(u8::is_ascii_hexdigit).then(|| rest.as_bstr()) })?; let candidate = iter.clone().any(|token| !token.is_empty()).then_some(candidate); @@ -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_or(token.as_ptr(), |token| token.as_ptr()); + let first_token_ptr = iter.last().map_or(token.as_ptr(), <[_]>::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) } @@ -234,7 +234,7 @@ fn short_describe_prefix(name: &BStr) -> Option<&BStr> { let mut iter = name.split(|b| *b == b'-'); let candidate = iter .next() - .and_then(|prefix| prefix.iter().all(|b| b.is_ascii_hexdigit()).then(|| prefix.as_bstr())); + .and_then(|prefix| prefix.iter().all(u8::is_ascii_hexdigit).then(|| prefix.as_bstr())); (iter.count() == 1).then_some(candidate).flatten() } @@ -560,13 +560,13 @@ where invalid => return Err(Error::InvalidObject { input: invalid.into() }), }; delegate.peel_until(target).ok_or(Error::Delegate)?; - } else if past_sep.and_then(|i| i.first()) == Some(&b'!') { + } else if past_sep.and_then(<[_]>::first) == Some(&b'!') { delegate .kind(spec::Kind::ExcludeReachableFromParents) .ok_or(Error::Delegate)?; delegate.done(); return Ok(input[cursor + 1..].as_bstr()); - } else if past_sep.and_then(|i| i.first()) == Some(&b'@') { + } else if past_sep.and_then(<[_]>::first) == Some(&b'@') { delegate .kind(spec::Kind::IncludeReachableFromParents) .ok_or(Error::Delegate)?; |