@@ -117,13 +117,15 @@ pub fn traverse_commit_graph(repo: &gix::Repository, options: &CliOptions) -> Re
117117 Ok ( git_metrics)
118118}
119119
120+ type NumberOfCommitsBySignature = HashMap < Sig , usize > ;
121+
120122fn get_author_channel (
121123 repo : & gix:: Repository ,
122124 num_threads : usize ,
123125 bot_regex_pattern : & Option < MyRegex > ,
124126 mailmap : & gix:: mailmap:: Snapshot ,
125127) -> (
126- Vec < JoinHandle < Result < HashMap < Sig , usize > > > > ,
128+ Vec < JoinHandle < Result < NumberOfCommitsBySignature > > > ,
127129 crossbeam_channel:: Sender < ObjectId > ,
128130) {
129131 // we intentionally over-allocate threads a little as the main thread won't be very busy anyway
@@ -140,7 +142,7 @@ fn get_author_channel(
140142 let bot_regex_pattern = bot_regex_pattern. clone ( ) ;
141143 let rx = rx. clone ( ) ;
142144 move || -> anyhow:: Result < _ > {
143- let mut number_of_commits_by_signature: HashMap < Sig , usize > = HashMap :: new ( ) ;
145+ let mut number_of_commits_by_signature = NumberOfCommitsBySignature :: new ( ) ;
144146 // We are sure to see each object only once.
145147 repo. object_cache_size ( 0 ) ;
146148 while let Ok ( commit_id) = rx. recv ( ) {
@@ -160,22 +162,22 @@ fn get_author_channel(
160162 ( threads, tx)
161163}
162164
165+ type NumberOfCommitsByFilepath = HashMap < BString , usize > ;
166+ type ChurnPair = ( NumberOfCommitsByFilepath , usize ) ;
167+
163168fn get_churn_channel (
164169 repo : & gix:: Repository ,
165170 has_commit_graph_traversal_ended : & Arc < AtomicBool > ,
166171 total_number_of_commits : & Arc < AtomicUsize > ,
167172 churn_pool_size_opt : Option < usize > ,
168- ) -> Result < (
169- JoinHandle < Result < ( HashMap < BString , usize > , usize ) > > ,
170- Sender < ObjectId > ,
171- ) > {
173+ ) -> Result < ( JoinHandle < Result < ChurnPair > > , Sender < ObjectId > ) > {
172174 let ( tx, rx) = channel :: < gix:: hash:: ObjectId > ( ) ;
173175 let thread = std:: thread:: spawn ( {
174176 let repo = repo. clone ( ) ;
175177 let has_commit_graph_traversal_ended = has_commit_graph_traversal_ended. clone ( ) ;
176178 let total_number_of_commits = total_number_of_commits. clone ( ) ;
177179 move || -> Result < _ > {
178- let mut number_of_commits_by_file_path: HashMap < BString , usize > = HashMap :: new ( ) ;
180+ let mut number_of_commits_by_file_path = NumberOfCommitsByFilepath :: new ( ) ;
179181 let mut number_of_diffs_computed = 0 ;
180182 while let Ok ( commit_id) = rx. recv ( ) {
181183 let commit = repo. find_object ( commit_id) ?. into_commit ( ) ;
0 commit comments