diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
commit | e02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch) | |
tree | fd60ebbbb5299e16e5fca8c773ddb74f764760db /vendor/git2/src | |
parent | Adding debian version 1.73.0+dfsg1-1. (diff) | |
download | rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/git2/src')
-rw-r--r-- | vendor/git2/src/blame.rs | 35 | ||||
-rw-r--r-- | vendor/git2/src/commit.rs | 5 | ||||
-rw-r--r-- | vendor/git2/src/diff.rs | 3 | ||||
-rw-r--r-- | vendor/git2/src/lib.rs | 89 | ||||
-rw-r--r-- | vendor/git2/src/message.rs | 5 | ||||
-rw-r--r-- | vendor/git2/src/pathspec.rs | 5 | ||||
-rw-r--r-- | vendor/git2/src/reflog.rs | 2 | ||||
-rw-r--r-- | vendor/git2/src/remote.rs | 3 | ||||
-rw-r--r-- | vendor/git2/src/revwalk.rs | 8 | ||||
-rw-r--r-- | vendor/git2/src/stash.rs | 2 | ||||
-rw-r--r-- | vendor/git2/src/status.rs | 2 | ||||
-rw-r--r-- | vendor/git2/src/string_array.rs | 3 | ||||
-rw-r--r-- | vendor/git2/src/tree.rs | 2 |
13 files changed, 154 insertions, 10 deletions
diff --git a/vendor/git2/src/blame.rs b/vendor/git2/src/blame.rs index 496efa923..4bf41fed1 100644 --- a/vendor/git2/src/blame.rs +++ b/vendor/git2/src/blame.rs @@ -1,9 +1,11 @@ use crate::util::{self, Binding}; -use crate::{raw, signature, Oid, Repository, Signature}; -use std::marker; +use crate::{raw, signature, Error, Oid, Repository, Signature}; +use libc::c_char; +use std::iter::FusedIterator; use std::mem; use std::ops::Range; use std::path::Path; +use std::{marker, ptr}; /// Opaque structure to hold blame results. pub struct Blame<'repo> { @@ -29,6 +31,24 @@ pub struct BlameIter<'blame> { } impl<'repo> Blame<'repo> { + /// Get blame data for a file that has been modified in memory. + /// + /// Lines that differ between the buffer and the committed version are + /// marked as having a zero OID for their final_commit_id. + pub fn blame_buffer(&self, buffer: &[u8]) -> Result<Blame<'_>, Error> { + let mut raw = ptr::null_mut(); + + unsafe { + try_call!(raw::git_blame_buffer( + &mut raw, + self.raw, + buffer.as_ptr() as *const c_char, + buffer.len() + )); + Ok(Binding::from_raw(raw)) + } + } + /// Gets the number of hunks that exist in the blame structure. pub fn len(&self) -> usize { unsafe { raw::git_blame_get_hunk_count(self.raw) as usize } @@ -307,6 +327,8 @@ impl<'blame> DoubleEndedIterator for BlameIter<'blame> { } } +impl<'blame> FusedIterator for BlameIter<'blame> {} + impl<'blame> ExactSizeIterator for BlameIter<'blame> {} #[cfg(test)] @@ -345,6 +367,13 @@ mod tests { assert_eq!(hunk.final_start_line(), 1); assert_eq!(hunk.path(), Some(Path::new("foo/bar"))); assert_eq!(hunk.lines_in_hunk(), 0); - assert!(!hunk.is_boundary()) + assert!(!hunk.is_boundary()); + + let blame_buffer = blame.blame_buffer("\n".as_bytes()).unwrap(); + let line = blame_buffer.get_line(1).unwrap(); + + assert_eq!(blame_buffer.len(), 2); + assert_eq!(blame_buffer.iter().count(), 2); + assert!(line.final_commit_id().is_zero()); } } diff --git a/vendor/git2/src/commit.rs b/vendor/git2/src/commit.rs index c6e2bd10e..4887e927e 100644 --- a/vendor/git2/src/commit.rs +++ b/vendor/git2/src/commit.rs @@ -1,4 +1,5 @@ use libc; +use std::iter::FusedIterator; use std::marker; use std::mem; use std::ops::Range; @@ -376,6 +377,8 @@ impl<'repo, 'commit> DoubleEndedIterator for Parents<'commit, 'repo> { } } +impl<'repo, 'commit> FusedIterator for Parents<'commit, 'repo> {} + impl<'repo, 'commit> ExactSizeIterator for Parents<'commit, 'repo> {} /// Aborts iteration when a commit cannot be found @@ -400,6 +403,8 @@ impl<'commit> DoubleEndedIterator for ParentIds<'commit> { } } +impl<'commit> FusedIterator for ParentIds<'commit> {} + impl<'commit> ExactSizeIterator for ParentIds<'commit> {} impl<'repo> Clone for Commit<'repo> { diff --git a/vendor/git2/src/diff.rs b/vendor/git2/src/diff.rs index e039c76d5..16595509d 100644 --- a/vendor/git2/src/diff.rs +++ b/vendor/git2/src/diff.rs @@ -1,5 +1,6 @@ use libc::{c_char, c_int, c_void, size_t}; use std::ffi::CString; +use std::iter::FusedIterator; use std::marker; use std::mem; use std::ops::Range; @@ -959,6 +960,8 @@ impl<'diff> DoubleEndedIterator for Deltas<'diff> { self.range.next_back().and_then(|i| self.diff.get_delta(i)) } } +impl<'diff> FusedIterator for Deltas<'diff> {} + impl<'diff> ExactSizeIterator for Deltas<'diff> {} /// Line origin constants. diff --git a/vendor/git2/src/lib.rs b/vendor/git2/src/lib.rs index d2bc6f599..6dd75093b 100644 --- a/vendor/git2/src/lib.rs +++ b/vendor/git2/src/lib.rs @@ -65,7 +65,7 @@ //! source `Repository`, to ensure that they do not outlive the repository //! itself. -#![doc(html_root_url = "https://docs.rs/git2/0.17")] +#![doc(html_root_url = "https://docs.rs/git2/0.18")] #![allow(trivial_numeric_casts, trivial_casts)] #![deny(missing_docs)] #![warn(rust_2018_idioms)] @@ -415,6 +415,7 @@ pub enum FileFavor { bitflags! { /// Orderings that may be specified for Revwalk iteration. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct Sort: u32 { /// Sort the repository contents in no particular ordering. /// @@ -449,6 +450,7 @@ impl Sort { bitflags! { /// Types of credentials that can be requested by a credential callback. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct CredentialType: u32 { #[allow(missing_docs)] const USER_PASS_PLAINTEXT = raw::GIT_CREDTYPE_USERPASS_PLAINTEXT as u32; @@ -485,6 +487,7 @@ impl Default for CredentialType { bitflags! { /// Flags for the `flags` field of an IndexEntry. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct IndexEntryFlag: u16 { /// Set when the `extended_flags` field is valid. const EXTENDED = raw::GIT_INDEX_ENTRY_EXTENDED as u16; @@ -500,6 +503,7 @@ impl IndexEntryFlag { bitflags! { /// Flags for the `extended_flags` field of an IndexEntry. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct IndexEntryExtendedFlag: u16 { /// An "intent to add" entry from "git add -N" const INTENT_TO_ADD = raw::GIT_INDEX_ENTRY_INTENT_TO_ADD as u16; @@ -519,6 +523,7 @@ impl IndexEntryExtendedFlag { bitflags! { /// Flags for APIs that add files matching pathspec + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct IndexAddOption: u32 { #[allow(missing_docs)] const DEFAULT = raw::GIT_INDEX_ADD_DEFAULT as u32; @@ -550,6 +555,7 @@ impl Default for IndexAddOption { bitflags! { /// Flags for `Repository::open_ext` + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct RepositoryOpenFlags: u32 { /// Only open the specified path; don't walk upward searching. const NO_SEARCH = raw::GIT_REPOSITORY_OPEN_NO_SEARCH as u32; @@ -574,6 +580,7 @@ impl RepositoryOpenFlags { bitflags! { /// Flags for the return value of `Repository::revparse` + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct RevparseMode: u32 { /// The spec targeted a single object const SINGLE = raw::GIT_REVPARSE_SINGLE as u32; @@ -592,6 +599,7 @@ impl RevparseMode { bitflags! { /// The results of `merge_analysis` indicating the merge opportunities. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct MergeAnalysis: u32 { /// No merge is possible. const ANALYSIS_NONE = raw::GIT_MERGE_ANALYSIS_NONE as u32; @@ -622,6 +630,7 @@ impl MergeAnalysis { bitflags! { /// The user's stated preference for merges. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct MergePreference: u32 { /// No configuration was found that suggests a preferred behavior for /// merge. @@ -643,6 +652,7 @@ impl MergePreference { bitflags! { /// Flags controlling the behavior of ODB lookup operations + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct OdbLookupFlags: u32 { /// Don't call `git_odb_refresh` if the lookup fails. Useful when doing /// a batch of lookup operations for objects that may legitimately not @@ -997,6 +1007,7 @@ bitflags! { /// represents the status of file in the index relative to the HEAD, and the /// `STATUS_WT_*` set of flags represent the status of the file in the /// working directory relative to the index. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct Status: u32 { #[allow(missing_docs)] const CURRENT = raw::GIT_STATUS_CURRENT as u32; @@ -1047,6 +1058,7 @@ impl Status { bitflags! { /// Mode options for RepositoryInitOptions + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct RepositoryInitMode: u32 { /// Use permissions configured by umask - the default const SHARED_UMASK = raw::GIT_REPOSITORY_INIT_SHARED_UMASK as u32; @@ -1179,6 +1191,7 @@ bitflags! { /// Lastly, the following will only be returned for ignore "NONE". /// /// * WD_UNTRACKED - workdir contains untracked files + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct SubmoduleStatus: u32 { #[allow(missing_docs)] const IN_HEAD = raw::GIT_SUBMODULE_STATUS_IN_HEAD as u32; @@ -1275,6 +1288,7 @@ pub enum SubmoduleUpdate { bitflags! { /// ... + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct PathspecFlags: u32 { /// Use the default pathspec matching configuration. const DEFAULT = raw::GIT_PATHSPEC_DEFAULT as u32; @@ -1320,6 +1334,7 @@ impl Default for PathspecFlags { bitflags! { /// Types of notifications emitted from checkouts. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct CheckoutNotificationType: u32 { /// Notification about a conflict. const CONFLICT = raw::GIT_CHECKOUT_NOTIFY_CONFLICT as u32; @@ -1361,6 +1376,7 @@ pub enum DiffFormat { bitflags! { /// Formatting options for diff stats + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct DiffStatsFormat: raw::git_diff_stats_format_t { /// Don't generate any stats const NONE = raw::GIT_DIFF_STATS_NONE; @@ -1431,6 +1447,7 @@ pub enum StashApplyProgress { bitflags! { #[allow(missing_docs)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct StashApplyFlags: u32 { #[allow(missing_docs)] const DEFAULT = raw::GIT_STASH_APPLY_DEFAULT as u32; @@ -1453,6 +1470,7 @@ impl Default for StashApplyFlags { bitflags! { #[allow(missing_docs)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct StashFlags: u32 { #[allow(missing_docs)] const DEFAULT = raw::GIT_STASH_DEFAULT as u32; @@ -1485,6 +1503,7 @@ impl Default for StashFlags { bitflags! { #[allow(missing_docs)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct AttrCheckFlags: u32 { /// Check the working directory, then the index. const FILE_THEN_INDEX = raw::GIT_ATTR_CHECK_FILE_THEN_INDEX as u32; @@ -1505,6 +1524,7 @@ impl Default for AttrCheckFlags { bitflags! { #[allow(missing_docs)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct DiffFlags: u32 { /// File(s) treated as binary data. const BINARY = raw::GIT_DIFF_FLAG_BINARY as u32; @@ -1526,6 +1546,7 @@ impl DiffFlags { bitflags! { /// Options for [`Reference::normalize_name`]. + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct ReferenceFormat: u32 { /// No particular normalization. const NORMAL = raw::GIT_REFERENCE_FORMAT_NORMAL as u32; @@ -1578,4 +1599,70 @@ mod tests { assert_eq!(u32::from(FileMode::BlobGroupWritable), 0o100664); assert_eq!(u32::from(FileMode::BlobExecutable), 0o100755); } + + #[test] + fn bitflags_partial_eq() { + use super::{ + AttrCheckFlags, CheckoutNotificationType, CredentialType, DiffFlags, DiffStatsFormat, + IndexAddOption, IndexEntryExtendedFlag, IndexEntryFlag, MergeAnalysis, MergePreference, + OdbLookupFlags, PathspecFlags, ReferenceFormat, RepositoryInitMode, + RepositoryOpenFlags, RevparseMode, Sort, StashApplyFlags, StashFlags, Status, + SubmoduleStatus, + }; + + assert_eq!( + AttrCheckFlags::FILE_THEN_INDEX, + AttrCheckFlags::FILE_THEN_INDEX + ); + assert_eq!( + CheckoutNotificationType::CONFLICT, + CheckoutNotificationType::CONFLICT + ); + assert_eq!( + CredentialType::USER_PASS_PLAINTEXT, + CredentialType::USER_PASS_PLAINTEXT + ); + assert_eq!(DiffFlags::BINARY, DiffFlags::BINARY); + assert_eq!( + DiffStatsFormat::INCLUDE_SUMMARY, + DiffStatsFormat::INCLUDE_SUMMARY + ); + assert_eq!( + IndexAddOption::CHECK_PATHSPEC, + IndexAddOption::CHECK_PATHSPEC + ); + assert_eq!( + IndexEntryExtendedFlag::INTENT_TO_ADD, + IndexEntryExtendedFlag::INTENT_TO_ADD + ); + assert_eq!(IndexEntryFlag::EXTENDED, IndexEntryFlag::EXTENDED); + assert_eq!( + MergeAnalysis::ANALYSIS_FASTFORWARD, + MergeAnalysis::ANALYSIS_FASTFORWARD + ); + assert_eq!( + MergePreference::FASTFORWARD_ONLY, + MergePreference::FASTFORWARD_ONLY + ); + assert_eq!(OdbLookupFlags::NO_REFRESH, OdbLookupFlags::NO_REFRESH); + assert_eq!(PathspecFlags::FAILURES_ONLY, PathspecFlags::FAILURES_ONLY); + assert_eq!( + ReferenceFormat::ALLOW_ONELEVEL, + ReferenceFormat::ALLOW_ONELEVEL + ); + assert_eq!( + RepositoryInitMode::SHARED_ALL, + RepositoryInitMode::SHARED_ALL + ); + assert_eq!(RepositoryOpenFlags::CROSS_FS, RepositoryOpenFlags::CROSS_FS); + assert_eq!(RevparseMode::RANGE, RevparseMode::RANGE); + assert_eq!(Sort::REVERSE, Sort::REVERSE); + assert_eq!( + StashApplyFlags::REINSTATE_INDEX, + StashApplyFlags::REINSTATE_INDEX + ); + assert_eq!(StashFlags::INCLUDE_IGNORED, StashFlags::INCLUDE_IGNORED); + assert_eq!(Status::WT_MODIFIED, Status::WT_MODIFIED); + assert_eq!(SubmoduleStatus::WD_ADDED, SubmoduleStatus::WD_ADDED); + } } diff --git a/vendor/git2/src/message.rs b/vendor/git2/src/message.rs index 398f11659..a7041da3a 100644 --- a/vendor/git2/src/message.rs +++ b/vendor/git2/src/message.rs @@ -1,6 +1,7 @@ use core::ops::Range; use std::ffi::CStr; use std::ffi::CString; +use std::iter::FusedIterator; use std::ptr; use libc::{c_char, c_int}; @@ -171,6 +172,8 @@ impl<'pair> Iterator for MessageTrailersStrsIterator<'pair> { } } +impl FusedIterator for MessageTrailersStrsIterator<'_> {} + impl ExactSizeIterator for MessageTrailersStrsIterator<'_> { fn len(&self) -> usize { self.0.range.len() @@ -213,6 +216,8 @@ impl<'pair> Iterator for MessageTrailersBytesIterator<'pair> { } } +impl FusedIterator for MessageTrailersBytesIterator<'_> {} + impl ExactSizeIterator for MessageTrailersBytesIterator<'_> { fn len(&self) -> usize { self.0.range.len() diff --git a/vendor/git2/src/pathspec.rs b/vendor/git2/src/pathspec.rs index 3df2e7681..48174fcc1 100644 --- a/vendor/git2/src/pathspec.rs +++ b/vendor/git2/src/pathspec.rs @@ -1,5 +1,5 @@ use libc::size_t; -use std::iter::IntoIterator; +use std::iter::{FusedIterator, IntoIterator}; use std::marker; use std::ops::Range; use std::path::Path; @@ -297,6 +297,7 @@ impl<'list> DoubleEndedIterator for PathspecEntries<'list> { self.range.next_back().and_then(|i| self.list.entry(i)) } } +impl<'list> FusedIterator for PathspecEntries<'list> {} impl<'list> ExactSizeIterator for PathspecEntries<'list> {} impl<'list> Iterator for PathspecDiffEntries<'list> { @@ -313,6 +314,7 @@ impl<'list> DoubleEndedIterator for PathspecDiffEntries<'list> { self.range.next_back().and_then(|i| self.list.diff_entry(i)) } } +impl<'list> FusedIterator for PathspecDiffEntries<'list> {} impl<'list> ExactSizeIterator for PathspecDiffEntries<'list> {} impl<'list> Iterator for PathspecFailedEntries<'list> { @@ -331,6 +333,7 @@ impl<'list> DoubleEndedIterator for PathspecFailedEntries<'list> { .and_then(|i| self.list.failed_entry(i)) } } +impl<'list> FusedIterator for PathspecFailedEntries<'list> {} impl<'list> ExactSizeIterator for PathspecFailedEntries<'list> {} #[cfg(test)] diff --git a/vendor/git2/src/reflog.rs b/vendor/git2/src/reflog.rs index 61509191e..bbd2140ab 100644 --- a/vendor/git2/src/reflog.rs +++ b/vendor/git2/src/reflog.rs @@ -1,4 +1,5 @@ use libc::size_t; +use std::iter::FusedIterator; use std::marker; use std::ops::Range; use std::str; @@ -174,6 +175,7 @@ impl<'reflog> DoubleEndedIterator for ReflogIter<'reflog> { self.range.next_back().and_then(|i| self.reflog.get(i)) } } +impl<'reflog> FusedIterator for ReflogIter<'reflog> {} impl<'reflog> ExactSizeIterator for ReflogIter<'reflog> {} #[cfg(test)] diff --git a/vendor/git2/src/remote.rs b/vendor/git2/src/remote.rs index 98f4cd8b6..f36db6844 100644 --- a/vendor/git2/src/remote.rs +++ b/vendor/git2/src/remote.rs @@ -1,5 +1,6 @@ use libc; use raw::git_strarray; +use std::iter::FusedIterator; use std::marker; use std::mem; use std::ops::Range; @@ -462,6 +463,7 @@ impl<'repo> DoubleEndedIterator for Refspecs<'repo> { .and_then(|i| self.remote.get_refspec(i)) } } +impl<'repo> FusedIterator for Refspecs<'repo> {} impl<'repo> ExactSizeIterator for Refspecs<'repo> {} #[allow(missing_docs)] // not documented in libgit2 :( @@ -588,6 +590,7 @@ impl<'cb> Binding for FetchOptions<'cb> { prune: crate::call::convert(&self.prune), update_fetchhead: crate::call::convert(&self.update_fetchhead), download_tags: crate::call::convert(&self.download_tags), + depth: 0, // GIT_FETCH_DEPTH_FULL. follow_redirects: self.follow_redirects.raw(), custom_headers: git_strarray { count: self.custom_headers_ptrs.len(), diff --git a/vendor/git2/src/revwalk.rs b/vendor/git2/src/revwalk.rs index 04cf3f3e4..7837f00d6 100644 --- a/vendor/git2/src/revwalk.rs +++ b/vendor/git2/src/revwalk.rs @@ -157,7 +157,7 @@ impl<'repo> Revwalk<'repo> { /// the walk. pub fn with_hide_callback<'cb, C>( self, - callback: &'cb C, + callback: &'cb mut C, ) -> Result<RevwalkWithHideCb<'repo, 'cb, C>, Error> where C: FnMut(Oid) -> bool, @@ -170,7 +170,7 @@ impl<'repo> Revwalk<'repo> { raw::git_revwalk_add_hide_cb( r.revwalk.raw(), Some(revwalk_hide_cb::<C>), - callback as *const _ as *mut c_void, + callback as *mut _ as *mut c_void, ); }; Ok(r) @@ -304,8 +304,8 @@ mod tests { walk.reset().unwrap(); walk.push_head().unwrap(); - let hide_cb = |oid| oid == target; - let mut walk = walk.with_hide_callback(&hide_cb).unwrap(); + let mut hide_cb = |oid| oid == target; + let mut walk = walk.with_hide_callback(&mut hide_cb).unwrap(); assert_eq!(walk.by_ref().count(), 0); diff --git a/vendor/git2/src/stash.rs b/vendor/git2/src/stash.rs index bff9e49de..6fcd525d2 100644 --- a/vendor/git2/src/stash.rs +++ b/vendor/git2/src/stash.rs @@ -58,7 +58,7 @@ impl<'a> StashSaveOptions<'a> { /// This function is unsafe as the pointer is only valid so long as this /// structure is not moved, modified, or used elsewhere. pub unsafe fn raw(&mut self) -> *const raw::git_stash_save_options { - self.raw_opts.flags = self.flags.unwrap_or_else(StashFlags::empty).bits as c_uint; + self.raw_opts.flags = self.flags.unwrap_or_else(StashFlags::empty).bits() as c_uint; self.raw_opts.message = crate::call::convert(&self.message); self.raw_opts.paths.count = self.pathspec_ptrs.len() as size_t; self.raw_opts.paths.strings = self.pathspec_ptrs.as_ptr() as *mut _; diff --git a/vendor/git2/src/status.rs b/vendor/git2/src/status.rs index 024e9fcd6..a5a8cffd3 100644 --- a/vendor/git2/src/status.rs +++ b/vendor/git2/src/status.rs @@ -1,5 +1,6 @@ use libc::{c_char, c_uint, size_t}; use std::ffi::CString; +use std::iter::FusedIterator; use std::marker; use std::mem; use std::ops::Range; @@ -303,6 +304,7 @@ impl<'a> DoubleEndedIterator for StatusIter<'a> { self.range.next_back().and_then(|i| self.statuses.get(i)) } } +impl<'a> FusedIterator for StatusIter<'a> {} impl<'a> ExactSizeIterator for StatusIter<'a> {} impl<'a> IntoIterator for &'a Statuses<'a> { diff --git a/vendor/git2/src/string_array.rs b/vendor/git2/src/string_array.rs index 1aa6fbb41..c77ccdab9 100644 --- a/vendor/git2/src/string_array.rs +++ b/vendor/git2/src/string_array.rs @@ -1,5 +1,6 @@ //! Bindings to libgit2's raw `git_strarray` type +use std::iter::FusedIterator; use std::ops::Range; use std::str; @@ -108,6 +109,7 @@ impl<'a> DoubleEndedIterator for Iter<'a> { self.range.next_back().map(|i| self.arr.get(i)) } } +impl<'a> FusedIterator for Iter<'a> {} impl<'a> ExactSizeIterator for Iter<'a> {} impl<'a> Iterator for IterBytes<'a> { @@ -124,6 +126,7 @@ impl<'a> DoubleEndedIterator for IterBytes<'a> { self.range.next_back().and_then(|i| self.arr.get_bytes(i)) } } +impl<'a> FusedIterator for IterBytes<'a> {} impl<'a> ExactSizeIterator for IterBytes<'a> {} impl Drop for StringArray { diff --git a/vendor/git2/src/tree.rs b/vendor/git2/src/tree.rs index 2a117b4ca..78b241384 100644 --- a/vendor/git2/src/tree.rs +++ b/vendor/git2/src/tree.rs @@ -1,6 +1,7 @@ use libc::{self, c_char, c_int, c_void}; use std::cmp::Ordering; use std::ffi::{CStr, CString}; +use std::iter::FusedIterator; use std::marker; use std::mem; use std::ops::Range; @@ -401,6 +402,7 @@ impl<'tree> DoubleEndedIterator for TreeIter<'tree> { self.range.next_back().and_then(|i| self.tree.get(i)) } } +impl<'tree> FusedIterator for TreeIter<'tree> {} impl<'tree> ExactSizeIterator for TreeIter<'tree> {} #[cfg(test)] |