History

thanks clippy

compatibility with Rust 1.71

Sebastian Thiel committed 3 years ago

Commit 3ef32af1 parent cbb0db89 files · +12 −18Browse files

Unified · Split

9 files
  1. gitoxide-core/src/hours/util.rs +2 −2
  2. gix-config/src/file/access/mutate.rs +3 −6
  3. gix-config/src/file/mutable/mod.rs +1 −1
  4. gix-discover/src/repository.rs +1 −1
  5. gix-pack/src/cache/object.rs +1 −1
  6. gix-pack/src/data/output/count/objects/reduce.rs +1 −1
  7. gix-pack/src/data/output/entry/iter_from_counts.rs +1 −1
  8. gix-transport/src/lib.rs +1 −4
  9. gix/src/lib.rs +1 −1
gitoxide-core/src/hours/util.rs+2−2
@@ -158,7 +158,7 @@ impl LineStats { · 157 unmodified lines
158158 /// An index able to address any commit
159159 pub type CommitIdx = u32;
160160
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<'_>) {
162162 if let Some(Ok(blob)) = line_stats.then(|| id.object()) {
163163 let nl = blob.data.lines_with_terminator().count();
164164 lines.added += nl;
@@ -168,7 +168,7 @@ pub fn add_lines(line_stats: bool, lines_counter: Option<&AtomicUsize>, mut line · 3 unmodified lines
168168 }
169169 }
170170
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<'_>) {
172172 if let Some(Ok(blob)) = line_stats.then(|| id.object()) {
173173 let nl = blob.data.lines_with_terminator().count();
174174 lines.removed += nl;
gix-config/src/file/access/mutate.rs+3−6
@@ -20,8 +20,7 @@ impl<'event> File<'event> { · 19 unmodified lines
2020 ) -> Result<SectionMut<'a, 'event>, lookup::existing::Error> {
2121 let id = self
2222 .section_ids_by_name_and_subname(name.as_ref(), subsection_name)?
23− .rev()
24− .next()
23+ .next_back()
2524 .expect("BUG: Section lookup vec was empty");
2625 let nl = self.detect_newline_style_smallvec();
2726 Ok(self
@@ -212,8 +211,7 @@ impl<'event> File<'event> { · 184 unmodified lines
212211 let id = self
213212 .section_ids_by_name_and_subname(name, subsection_name.into())
214213 .ok()?
215− .rev()
216− .next()?;
214+ .next_back()?;
217215 self.remove_section_by_id(id)
218216 }
219217
@@ -298,8 +296,7 @@ impl<'event> File<'event> { · 78 unmodified lines
298296 ) -> Result<(), rename_section::Error> {
299297 let id = self
300298 .section_ids_by_name_and_subname(name.as_ref(), subsection_name.into())?
301− .rev()
302− .next()
299+ .next_back()
303300 .expect("list of sections were empty, which violates invariant");
304301 let section = self.sections.get_mut(&id).expect("known section-id");
305302 section.header = section::Header::new(new_name, new_subsection_name)?;
gix-config/src/file/mutable/mod.rs+1−1
@@ -74,7 +74,7 @@ impl<'a> Whitespace<'a> { · 73 unmodified lines
7474 .find_map(|(idx, e)| matches!(e, Event::SectionKey(_)).then(|| idx));
7575 key_pos
7676 .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 {
7878 Event::Whitespace(s) => Some(s.clone()),
7979 _ => None,
8080 });
gix-discover/src/repository.rs+1−1
@@ -55,7 +55,7 @@ mod path { · 54 unmodified lines
5555 ) -> Option<Self> {
5656 let cwd = current_dir.as_ref();
5757 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)) {
5959 dir
6060 } else {
6161 gix_path::normalize(&dir, cwd)?.into_owned()
gix-pack/src/cache/object.rs+1−1
@@ -43,7 +43,7 @@ mod memory { · 42 unmodified lines
4343 MemoryCappedHashmap {
4444 inner: clru::CLruCache::with_config(
4545 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)
4747 .with_scale(CustomScale),
4848 ),
4949 free_list: Vec::new(),
gix-pack/src/data/output/count/objects/reduce.rs+1−1
@@ -21,7 +21,7 @@ where · 20 unmodified lines
2121 total: Default::default(),
2222 counts: Default::default(),
2323 progress,
24− _err: PhantomData::default(),
24+ _err: PhantomData,
2525 }
2626 }
2727 }
gix-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -288,7 +288,7 @@ mod reduce { · 287 unmodified lines
288288 fn default() -> Self {
289289 Statistics {
290290 total: Default::default(),
291− _err: PhantomData::default(),
291+ _err: PhantomData,
292292 }
293293 }
294294 }
gix-transport/src/lib.rs+1−4
@@ -86,10 +86,7 @@ pub use traits::IsSpuriousError; · 85 unmodified lines
8686 pub mod client;
8787
8888 #[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")))]
9390 pub use client::connect;
9491
9592 #[cfg(all(feature = "async-client", feature = "blocking-client"))]
gix/src/lib.rs+1−1
@@ -99,7 +99,7 @@ pub use gix_object as objs; · 98 unmodified lines
9999 pub use gix_object::bstr;
100100 pub use gix_odb as odb;
101101 pub use gix_prompt as prompt;
102−#[cfg(all(feature = "gix-protocol"))]
102+#[cfg(feature = "gix-protocol")]
103103 pub use gix_protocol as protocol;
104104 pub use gix_ref as refs;
105105 pub use gix_refspec as refspec;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t