Showing the changes to git-pack/src (12 of 100 files). Show all
Unified · Split
| @@ -143,7 +143,7 @@ where · 142 unmodified lines | |||
| 143 | ( | 143 | ( |
| 144 | Vec::<u8>::with_capacity(4096), | 144 | Vec::<u8>::with_capacity(4096), |
| 145 | lock(&object_progress) | 145 | 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), |
| 147 | new_thread_state(), | 147 | new_thread_state(), |
| 148 | resolve.clone(), | 148 | resolve.clone(), |
| 149 | inspect_object.clone(), | 149 | inspect_object.clone(), |
| @@ -40,7 +40,7 @@ mod memory { · 39 unmodified lines | |||
| 40 | .with_scale(CustomScale), | 40 | .with_scale(CustomScale), |
| 41 | ), | 41 | ), |
| 42 | free_list: Vec::new(), | 42 | 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)")), |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| @@ -113,7 +113,7 @@ mod _static { · 66 unmodified lines | |||
| 113 | StaticLinkedList { | 113 | StaticLinkedList { |
| 114 | inner: Default::default(), | 114 | inner: Default::default(), |
| 115 | free_list: Vec::new(), | 115 | free_list: Vec::new(), |
| 116 | debug: git_features::cache::Debug::new(format!("StaticLinkedList<{}>", SIZE)), | 116 | debug: git_features::cache::Debug::new(format!("StaticLinkedList<{SIZE}>")), |
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| 119 | } | 119 | } |
| @@ -49,7 +49,7 @@ mod memory { · 48 unmodified lines | |||
| 49 | .with_scale(CustomScale), | 49 | .with_scale(CustomScale), |
| 50 | ), | 50 | ), |
| 51 | free_list: Vec::new(), | 51 | 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)")), |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| @@ -23,8 +23,7 @@ impl data::File { · 22 unmodified lines | |||
| 23 | let pack_len = data.len(); | 23 | let pack_len = data.len(); |
| 24 | if pack_len < N32_SIZE * 3 + hash_len { | 24 | if pack_len < N32_SIZE * 3 + hash_len { |
| 25 | return Err(data::header::decode::Error::Corrupt(format!( | 25 | return Err(data::header::decode::Error::Corrupt(format!( |
| 26 | "Pack data of size {} is too small for even an empty pack with shortest hash", | 26 | "Pack data of size {pack_len} is too small for even an empty pack with shortest hash" |
| 27 | pack_len | ||
| 28 | ))); | 27 | ))); |
| 29 | } | 28 | } |
| 30 | let (kind, num_objects) = | 29 | let (kind, num_objects) = |
| @@ -90,11 +90,11 @@ where · 89 unmodified lines | |||
| 90 | } else { | 90 | } else { |
| 91 | header_bytes.len() as u64 | 91 | header_bytes.len() as u64 |
| 92 | }; | 92 | }; |
| 93 | self.output.seek(std::io::SeekFrom::Start(0))?; | 93 | self.output.rewind()?; |
| 94 | self.output.write_all(&header_bytes[..])?; | 94 | self.output.write_all(&header_bytes[..])?; |
| 95 | self.output.flush()?; | 95 | self.output.flush()?; |
| 96 | 96 | ||
| 97 | self.output.seek(std::io::SeekFrom::Start(0))?; | 97 | self.output.rewind()?; |
| 98 | let interrupt_never = std::sync::atomic::AtomicBool::new(false); | 98 | let interrupt_never = std::sync::atomic::AtomicBool::new(false); |
| 99 | let digest = hash::bytes( | 99 | let digest = hash::bytes( |
| 100 | &mut self.output, | 100 | &mut self.output, |
| @@ -79,7 +79,7 @@ where · 78 unmodified lines | |||
| 79 | { | 79 | { |
| 80 | let mut p = progress | 80 | let mut p = progress |
| 81 | .lock() | 81 | .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); |
| 83 | p.init(None, git_features::progress::count("objects")); | 83 | p.init(None, git_features::progress::count("objects")); |
| 84 | p | 84 | p |
| 85 | }, | 85 | }, |
| @@ -143,7 +143,7 @@ pub(crate) mod function { · 142 unmodified lines | |||
| 143 | Vec::new(), // object data buffer | 143 | Vec::new(), // object data buffer |
| 144 | progress | 144 | progress |
| 145 | .lock() | 145 | .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), |
| 147 | ) | 147 | ) |
| 148 | } | 148 | } |
| 149 | }, | 149 | }, |
| @@ -40,7 +40,7 @@ impl index::File { · 39 unmodified lines | |||
| 40 | let footer_size = hash_len * 2; | 40 | let footer_size = hash_len * 2; |
| 41 | if idx_len < FAN_LEN * N32_SIZE + footer_size { | 41 | if idx_len < FAN_LEN * N32_SIZE + footer_size { |
| 42 | return Err(Error::Corrupt { | 42 | 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"), |
| 44 | }); | 44 | }); |
| 45 | } | 45 | } |
| 46 | let (kind, fan, num_objects) = { | 46 | let (kind, fan, num_objects) = { |
| @@ -76,7 +76,7 @@ where · 75 unmodified lines | |||
| 76 | fn feed(&mut self, input: Self::Input) -> Result<(), Self::Error> { | 76 | fn feed(&mut self, input: Self::Input) -> Result<(), Self::Error> { |
| 77 | let chunk_stats: Vec<_> = match input { | 77 | let chunk_stats: Vec<_> = match input { |
| 78 | Err(err @ traverse::Error::PackDecode { .. }) if !self.check.fatal_decode_error() => { | 78 | 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}")); |
| 80 | return Ok(()); | 80 | return Ok(()); |
| 81 | } | 81 | } |
| 82 | res => res, | 82 | res => res, |
| @@ -150,7 +150,7 @@ impl index::File { · 149 unmodified lines | |||
| 150 | ); | 150 | ); |
| 151 | match result { | 151 | match result { |
| 152 | Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => { | 152 | 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}")); |
| 154 | Ok(()) | 154 | Ok(()) |
| 155 | } | 155 | } |
| 156 | res => res, | 156 | res => res, |
| @@ -136,7 +136,7 @@ impl index::File { · 135 unmodified lines | |||
| 136 | new_processor(), | 136 | new_processor(), |
| 137 | Vec::with_capacity(2048), // decode buffer | 137 | Vec::with_capacity(2048), // decode buffer |
| 138 | lock(&reduce_progress) | 138 | 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 |
| 140 | ) | 140 | ) |
| 141 | } | 141 | } |
| 142 | }; | 142 | }; |
| @@ -171,7 +171,7 @@ impl index::File { · 28 unmodified lines | |||
| 171 | progress.inc(); | 171 | progress.inc(); |
| 172 | let stat = match result { | 172 | let stat = match result { |
| 173 | Err(err @ Error::PackDecode { .. }) if !check.fatal_decode_error() => { | 173 | 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}")); |
| 175 | continue; | 175 | continue; |
| 176 | } | 176 | } |
| 177 | res => res, | 177 | res => res, |
| @@ -170,8 +170,7 @@ impl crate::index::File { · 169 unmodified lines | |||
| 170 | } | 170 | } |
| 171 | if num_objects != anticipated_num_objects { | 171 | if num_objects != anticipated_num_objects { |
| 172 | objects_progress.info(format!( | 172 | objects_progress.info(format!( |
| 173 | "{} objects were resolved into {} objects during thin-pack resolution", | 173 | "{anticipated_num_objects} objects were resolved into {num_objects} objects during thin-pack resolution" |
| 174 | anticipated_num_objects, num_objects | ||
| 175 | )); | 174 | )); |
| 176 | } | 175 | } |
| 177 | let num_objects: u32 = num_objects | 176 | let num_objects: u32 = num_objects |