diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix/src/object | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-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/src/object')
-rw-r--r-- | vendor/gix/src/object/tree/diff/for_each.rs | 10 | ||||
-rw-r--r-- | vendor/gix/src/object/tree/diff/rewrites.rs | 2 | ||||
-rw-r--r-- | vendor/gix/src/object/tree/diff/tracked.rs | 5 |
3 files changed, 8 insertions, 9 deletions
diff --git a/vendor/gix/src/object/tree/diff/for_each.rs b/vendor/gix/src/object/tree/diff/for_each.rs index 5cae4cf2f..a72033182 100644 --- a/vendor/gix/src/object/tree/diff/for_each.rs +++ b/vendor/gix/src/object/tree/diff/for_each.rs @@ -209,9 +209,9 @@ where fn visit(&mut self, change: gix_diff::tree::visit::Change) -> gix_diff::tree::visit::Action { match self.tracked.as_mut() { - Some(tracked) => tracked - .try_push_change(change, self.recorder.path()) - .map(|change| { + Some(tracked) => tracked.try_push_change(change, self.recorder.path()).map_or( + gix_diff::tree::visit::Action::Continue, + |change| { Self::emit_change( change, self.recorder.path(), @@ -220,8 +220,8 @@ where self.other_repo, &mut self.err, ) - }) - .unwrap_or(gix_diff::tree::visit::Action::Continue), + }, + ), None => Self::emit_change( change, self.recorder.path(), diff --git a/vendor/gix/src/object/tree/diff/rewrites.rs b/vendor/gix/src/object/tree/diff/rewrites.rs index 304894d15..1502048ec 100644 --- a/vendor/gix/src/object/tree/diff/rewrites.rs +++ b/vendor/gix/src/object/tree/diff/rewrites.rs @@ -49,7 +49,7 @@ pub struct Outcome { pub num_similarity_checks_skipped_for_copy_tracking_due_to_limit: usize, } -/// The error returned by [`Rewrites::try_from_config()]. +/// The error returned by [`Rewrites::try_from_config()`]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { diff --git a/vendor/gix/src/object/tree/diff/tracked.rs b/vendor/gix/src/object/tree/diff/tracked.rs index 3bbe01624..d6042fcbc 100644 --- a/vendor/gix/src/object/tree/diff/tracked.rs +++ b/vendor/gix/src/object/tree/diff/tracked.rs @@ -311,7 +311,7 @@ fn needs_exact_match(percentage: Option<f32>) -> bool { percentage.map_or(true, |p| p >= 1.0) } -/// <src_idx, src, possibly diff stat> +/// <`src_idx`, src, possibly diff stat> type SourceTuple<'a> = (usize, &'a Item, Option<DiffLineStats>); /// Find `item` in our set of items ignoring `item_idx` to avoid finding ourselves, by similarity indicated by `percentage`. @@ -337,8 +337,7 @@ fn find_match<'a>( let end = items .iter() .position(|a| a.change.oid() != item_id) - .map(|idx| first_idx + idx) - .unwrap_or(items.len()); + .map_or(items.len(), |idx| first_idx + idx); first_idx..end }) { Some(range) => range, |