@@ -14,7 +14,7 @@ use crate::{
14
14
data:: EntryRange ,
15
15
} ;
16
16
17
- mod node {
17
+ mod root {
18
18
use crate :: cache:: delta:: { traverse:: util:: ItemSliceSync , Item } ;
19
19
20
20
/// An item returned by `iter_root_chunks`, allowing access to the `data` stored alongside nodes in a [`Tree`].
@@ -26,7 +26,10 @@ mod node {
26
26
impl < ' a , T : Send > Node < ' a , T > {
27
27
/// SAFETY: The child_items must be unique among between users of the `ItemSliceSync`.
28
28
#[ allow( unsafe_code) ]
29
- pub ( crate ) unsafe fn new ( item : & ' a mut Item < T > , child_items : & ' a ItemSliceSync < ' a , Item < T > > ) -> Self {
29
+ pub ( in crate :: cache:: delta:: traverse) unsafe fn new (
30
+ item : & ' a mut Item < T > ,
31
+ child_items : & ' a ItemSliceSync < ' a , Item < T > > ,
32
+ ) -> Self {
30
33
Node { item, child_items }
31
34
}
32
35
}
@@ -68,7 +71,7 @@ mod node {
68
71
}
69
72
}
70
73
71
- pub ( crate ) struct State < ' items , F , MBFN , T : Send > {
74
+ pub ( in crate :: cache :: delta :: traverse ) struct State < ' items , F , MBFN , T : Send > {
72
75
pub delta_bytes : Vec < u8 > ,
73
76
pub fully_resolved_delta_bytes : Vec < u8 > ,
74
77
pub progress : Box < dyn Progress > ,
@@ -78,7 +81,7 @@ pub(crate) struct State<'items, F, MBFN, T: Send> {
78
81
}
79
82
80
83
#[ allow( clippy:: too_many_arguments) ]
81
- pub ( crate ) fn deltas < T , F , MBFN , E , R > (
84
+ pub ( in crate :: cache :: delta :: traverse ) fn deltas < T , F , MBFN , E , R > (
82
85
objects : gix_features:: progress:: StepShared ,
83
86
size : gix_features:: progress:: StepShared ,
84
87
item : & mut Item < T > ,
@@ -118,9 +121,9 @@ where
118
121
// each node is a base, and its children always start out as deltas which become a base after applying them.
119
122
// These will be pushed onto our stack until all are processed
120
123
let root_level = 0 ;
121
- // SAFETY: The child items are unique
124
+ // SAFETY: The child items are unique, as `item` is the root of a tree of dependent child items.
122
125
#[ allow( unsafe_code) ]
123
- let root_node = unsafe { node :: Node :: new ( item, child_items) } ;
126
+ let root_node = unsafe { root :: Node :: new ( item, child_items) } ;
124
127
let mut nodes: Vec < _ > = vec ! [ ( root_level, root_node) ] ;
125
128
while let Some ( ( level, mut base) ) = nodes. pop ( ) {
126
129
if should_interrupt. load ( Ordering :: Relaxed ) {
@@ -240,7 +243,7 @@ fn deltas_mt<T, F, MBFN, E, R>(
240
243
objects : gix_features:: progress:: StepShared ,
241
244
size : gix_features:: progress:: StepShared ,
242
245
progress : & dyn Progress ,
243
- nodes : Vec < ( u16 , node :: Node < ' _ , T > ) > ,
246
+ nodes : Vec < ( u16 , root :: Node < ' _ , T > ) > ,
244
247
resolve : F ,
245
248
resolve_data : & R ,
246
249
modify_base : MBFN ,
0 commit comments