History

thanks clippy

Sebastian Thiel committed 3 years ago

Commit bac57dd1 parent e22080e100 files · +172 −230Browse files

Showing the changes to git-pack/src (12 of 100 files). Show all

Unified · Split

12 files
  1. git-pack/src/cache/delta/traverse/mod.rs +1 −1
  2. git-pack/src/cache/lru.rs +2 −2
  3. git-pack/src/cache/object.rs +1 −1
  4. git-pack/src/data/file/init.rs +1 −2
  5. git-pack/src/data/input/entries_to_bytes.rs +2 −2
  6. git-pack/src/data/output/count/objects/mod.rs +1 −1
  7. git-pack/src/data/output/entry/iter_from_counts.rs +1 −1
  8. git-pack/src/index/init.rs +1 −1
  9. git-pack/src/index/traverse/reduce.rs +1 −1
  10. git-pack/src/index/traverse/with_index.rs +1 −1
  11. git-pack/src/index/traverse/with_lookup.rs +2 −2
  12. git-pack/src/index/write/mod.rs +1 −2
git-pack/src/cache/delta/traverse/mod.rs+1−1
@@ -143,7 +143,7 @@ where · 142 unmodified lines
143143 (
144144 Vec::<u8>::with_capacity(4096),
145145 lock(&object_progress)
146− .add_child_with_id(format!("thread {}", thread_index), git_features::progress::UNKNOWN),
146+ .add_child_with_id(format!("thread {thread_index}"), git_features::progress::UNKNOWN),
147147 new_thread_state(),
148148 resolve.clone(),
149149 inspect_object.clone(),
git-pack/src/cache/lru.rs+2−2
@@ -40,7 +40,7 @@ mod memory { · 39 unmodified lines
4040 .with_scale(CustomScale),
4141 ),
4242 free_list: Vec::new(),
43− debug: git_features::cache::Debug::new(format!("MemoryCappedHashmap({}B)", memory_cap_in_bytes)),
43+ debug: git_features::cache::Debug::new(format!("MemoryCappedHashmap({memory_cap_in_bytes}B)")),
4444 }
4545 }
4646 }
@@ -113,7 +113,7 @@ mod _static { · 66 unmodified lines
113113 StaticLinkedList {
114114 inner: Default::default(),
115115 free_list: Vec::new(),
116− debug: git_features::cache::Debug::new(format!("StaticLinkedList<{}>", SIZE)),
116+ debug: git_features::cache::Debug::new(format!("StaticLinkedList<{SIZE}>")),
117117 }
118118 }
119119 }
git-pack/src/cache/object.rs+1−1
@@ -49,7 +49,7 @@ mod memory { · 48 unmodified lines
4949 .with_scale(CustomScale),
5050 ),
5151 free_list: Vec::new(),
52− debug: git_features::cache::Debug::new(format!("MemoryCappedObjectHashmap({}B)", memory_cap_in_bytes)),
52+ debug: git_features::cache::Debug::new(format!("MemoryCappedObjectHashmap({memory_cap_in_bytes}B)")),
5353 }
5454 }
5555 }
git-pack/src/data/file/init.rs+1−2
@@ -23,8 +23,7 @@ impl data::File { · 22 unmodified lines
2323 let pack_len = data.len();
2424 if pack_len < N32_SIZE * 3 + hash_len {
2525 return Err(data::header::decode::Error::Corrupt(format!(
26− "Pack data of size {} is too small for even an empty pack with shortest hash",
27− pack_len
26+ "Pack data of size {pack_len} is too small for even an empty pack with shortest hash"
2827 )));
2928 }
3029 let (kind, num_objects) =
git-pack/src/data/input/entries_to_bytes.rs+2−2
@@ -90,11 +90,11 @@ where · 89 unmodified lines
9090 } else {
9191 header_bytes.len() as u64
9292 };
93− self.output.seek(std::io::SeekFrom::Start(0))?;
93+ self.output.rewind()?;
9494 self.output.write_all(&header_bytes[..])?;
9595 self.output.flush()?;
9696
97− self.output.seek(std::io::SeekFrom::Start(0))?;
97+ self.output.rewind()?;
9898 let interrupt_never = std::sync::atomic::AtomicBool::new(false);
9999 let digest = hash::bytes(
100100 &mut self.output,
git-pack/src/data/output/count/objects/mod.rs+1−1
@@ -79,7 +79,7 @@ where · 78 unmodified lines
7979 {
8080 let mut p = progress
8181 .lock()
82− .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN);
82+ .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN);
8383 p.init(None, git_features::progress::count("objects"));
8484 p
8585 },
git-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -143,7 +143,7 @@ pub(crate) mod function { · 142 unmodified lines
143143 Vec::new(), // object data buffer
144144 progress
145145 .lock()
146− .add_child_with_id(format!("thread {}", n), git_features::progress::UNKNOWN),
146+ .add_child_with_id(format!("thread {n}"), git_features::progress::UNKNOWN),
147147 )
148148 }
149149 },
git-pack/src/index/init.rs+1−1
@@ -40,7 +40,7 @@ impl index::File { · 39 unmodified lines
4040 let footer_size = hash_len * 2;
4141 if idx_len < FAN_LEN * N32_SIZE + footer_size {
4242 return Err(Error::Corrupt {
43− message: format!("Pack index of size {} is too small for even an empty index", idx_len),
43+ message: format!("Pack index of size {idx_len} is too small for even an empty index"),
4444 });
4545 }
4646 let (kind, fan, num_objects) = {
git-pack/src/index/traverse/reduce.rs+1−1
@@ -76,7 +76,7 @@ where · 75 unmodified lines
7676 fn feed(&mut self, input: Self::Input) -> Result<(), Self::Error> {
7777 let chunk_stats: Vec<_> = match input {
7878 Err(err @ traverse::Error::PackDecode { .. }) if !self.check.fatal_decode_error() => {
79− lock(&self.progress).info(format!("Ignoring decode error: {}", err));
79+ lock(&self.progress).info(format!("Ignoring decode error: {err}"));
8080 return Ok(());
8181 }
8282 res => res,
git-pack/src/index/traverse/with_index.rs+1−1
@@ -150,7 +150,7 @@ impl index::File { · 149 unmodified lines
150150 );
151151 match result {
152152 Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => {
153− progress.info(format!("Ignoring decode error: {}", err));
153+ progress.info(format!("Ignoring decode error: {err}"));
154154 Ok(())
155155 }
156156 res => res,
git-pack/src/index/traverse/with_lookup.rs+2−2
@@ -136,7 +136,7 @@ impl index::File { · 135 unmodified lines
136136 new_processor(),
137137 Vec::with_capacity(2048), // decode buffer
138138 lock(&reduce_progress)
139− .add_child_with_id(format!("thread {}", index), git_features::progress::UNKNOWN), // per thread progress
139+ .add_child_with_id(format!("thread {index}"), git_features::progress::UNKNOWN), // per thread progress
140140 )
141141 }
142142 };
@@ -171,7 +171,7 @@ impl index::File { · 28 unmodified lines
171171 progress.inc();
172172 let stat = match result {
173173 Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => {
174− progress.info(format!("Ignoring decode error: {}", err));
174+ progress.info(format!("Ignoring decode error: {err}"));
175175 continue;
176176 }
177177 res => res,
git-pack/src/index/write/mod.rs+1−2
@@ -170,8 +170,7 @@ impl crate::index::File { · 169 unmodified lines
170170 }
171171 if num_objects != anticipated_num_objects {
172172 objects_progress.info(format!(
173− "{} objects were resolved into {} objects during thin-pack resolution",
174− anticipated_num_objects, num_objects
173+ "{anticipated_num_objects} objects were resolved into {num_objects} objects during thin-pack resolution"
175174 ));
176175 }
177176 let num_objects: u32 = num_objects

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