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