compatibility with Rust 1.71
Unified · Split
| @@ -158,7 +158,7 @@ impl LineStats { · 157 unmodified lines | ||
| 158 | 158 | /// An index able to address any commit |
| 159 | 159 | pub type CommitIdx = u32; |
| 160 | 160 | |
| 161 | −pub fn add_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, mut lines: &mut LineStats, id: gix::Id<'_>) { | |
| 161 | +pub fn add_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, lines: &mut LineStats, id: gix::Id<'_>) { | |
| 162 | 162 | if let Some(Ok(blob)) = line_stats.then(|| id.object()) { |
| 163 | 163 | let nl = blob.data.lines_with_terminator().count(); |
| 164 | 164 | lines.added += nl; |
| @@ -168,7 +168,7 @@ pub fn add_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, mut line · 3 unmodified lines | ||
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | −pub fn remove_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, mut lines: &mut LineStats, id: gix::Id<'_>) { | |
| 171 | +pub fn remove_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, lines: &mut LineStats, id: gix::Id<'_>) { | |
| 172 | 172 | if let Some(Ok(blob)) = line_stats.then(|| id.object()) { |
| 173 | 173 | let nl = blob.data.lines_with_terminator().count(); |
| 174 | 174 | lines.removed += nl; |
| @@ -20,8 +20,7 @@ impl<'event> File<'event> { · 19 unmodified lines | ||
| 20 | 20 | ) -> Result<SectionMut<'a, 'event>, lookup::existing::Error> { |
| 21 | 21 | let id = self |
| 22 | 22 | .section_ids_by_name_and_subname(name.as_ref(), subsection_name)? |
| 23 | − .rev() | |
| 24 | − .next() | |
| 23 | + .next_back() | |
| 25 | 24 | .expect("BUG: Section lookup vec was empty"); |
| 26 | 25 | let nl = self.detect_newline_style_smallvec(); |
| 27 | 26 | Ok(self |
| @@ -212,8 +211,7 @@ impl<'event> File<'event> { · 184 unmodified lines | ||
| 212 | 211 | let id = self |
| 213 | 212 | .section_ids_by_name_and_subname(name, subsection_name.into()) |
| 214 | 213 | .ok()? |
| 215 | − .rev() | |
| 216 | − .next()?; | |
| 214 | + .next_back()?; | |
| 217 | 215 | self.remove_section_by_id(id) |
| 218 | 216 | } |
| 219 | 217 | |
| @@ -298,8 +296,7 @@ impl<'event> File<'event> { · 78 unmodified lines | ||
| 298 | 296 | ) -> Result<(), rename_section::Error> { |
| 299 | 297 | let id = self |
| 300 | 298 | .section_ids_by_name_and_subname(name.as_ref(), subsection_name.into())? |
| 301 | − .rev() | |
| 302 | − .next() | |
| 299 | + .next_back() | |
| 303 | 300 | .expect("list of sections were empty, which violates invariant"); |
| 304 | 301 | let section = self.sections.get_mut(&id).expect("known section-id"); |
| 305 | 302 | section.header = section::Header::new(new_name, new_subsection_name)?; |
| @@ -74,7 +74,7 @@ impl<'a> Whitespace<'a> { · 73 unmodified lines | ||
| 74 | 74 | .find_map(|(idx, e)| matches!(e, Event::SectionKey(_)).then(|| idx)); |
| 75 | 75 | key_pos |
| 76 | 76 | .map(|key_pos| { |
| 77 | − let pre_key = s.0[..key_pos].iter().rev().next().and_then(|e| match e { | |
| 77 | + let pre_key = s.0[..key_pos].iter().next_back().and_then(|e| match e { | |
| 78 | 78 | Event::Whitespace(s) => Some(s.clone()), |
| 79 | 79 | _ => None, |
| 80 | 80 | }); |
| @@ -55,7 +55,7 @@ mod path { · 54 unmodified lines | ||
| 55 | 55 | ) -> Option<Self> { |
| 56 | 56 | let cwd = current_dir.as_ref(); |
| 57 | 57 | let normalize_on_trailing_dot_dot = |dir: PathBuf| -> Option<PathBuf> { |
| 58 | − if !matches!(dir.components().rev().next(), Some(std::path::Component::ParentDir)) { | |
| 58 | + if !matches!(dir.components().next_back(), Some(std::path::Component::ParentDir)) { | |
| 59 | 59 | dir |
| 60 | 60 | } else { |
| 61 | 61 | gix_path::normalize(&dir, cwd)?.into_owned() |
| @@ -43,7 +43,7 @@ mod memory { · 42 unmodified lines | ||
| 43 | 43 | MemoryCappedHashmap { |
| 44 | 44 | inner: clru::CLruCache::with_config( |
| 45 | 45 | clru::CLruCacheConfig::new(NonZeroUsize::new(memory_cap_in_bytes).expect("non zero")) |
| 46 | − .with_hasher(gix_hashtable::hash::Builder::default()) | |
| 46 | + .with_hasher(gix_hashtable::hash::Builder) | |
| 47 | 47 | .with_scale(CustomScale), |
| 48 | 48 | ), |
| 49 | 49 | free_list: Vec::new(), |
| @@ -21,7 +21,7 @@ where · 20 unmodified lines | ||
| 21 | 21 | total: Default::default(), |
| 22 | 22 | counts: Default::default(), |
| 23 | 23 | progress, |
| 24 | − _err: PhantomData::default(), | |
| 24 | + _err: PhantomData, | |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | } |
| @@ -288,7 +288,7 @@ mod reduce { · 287 unmodified lines | ||
| 288 | 288 | fn default() -> Self { |
| 289 | 289 | Statistics { |
| 290 | 290 | total: Default::default(), |
| 291 | − _err: PhantomData::default(), | |
| 291 | + _err: PhantomData, | |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | } |
| @@ -86,10 +86,7 @@ pub use traits::IsSpuriousError; · 85 unmodified lines | ||
| 86 | 86 | pub mod client; |
| 87 | 87 | |
| 88 | 88 | #[doc(inline)] |
| 89 | −#[cfg(any( | |
| 90 | − feature = "blocking-client", | |
| 91 | − all(feature = "async-client", any(feature = "async-std")) | |
| 92 | −))] | |
| 89 | +#[cfg(any(feature = "blocking-client", all(feature = "async-client", feature = "async-std")))] | |
| 93 | 90 | pub use client::connect; |
| 94 | 91 | |
| 95 | 92 | #[cfg(all(feature = "async-client", feature = "blocking-client"))] |
| @@ -99,7 +99,7 @@ pub use gix_object as objs; · 98 unmodified lines | ||
| 99 | 99 | pub use gix_object::bstr; |
| 100 | 100 | pub use gix_odb as odb; |
| 101 | 101 | pub use gix_prompt as prompt; |
| 102 | −#[cfg(all(feature = "gix-protocol"))] | |
| 102 | +#[cfg(feature = "gix-protocol")] | |
| 103 | 103 | pub use gix_protocol as protocol; |
| 104 | 104 | pub use gix_ref as refs; |
| 105 | 105 | pub use gix_refspec as refspec; |