File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,17 @@ async fn blobs_gc_protected() -> TestResult<()> {
3939 > ,
4040 > = blobs. clone ( ) . client ( ) ;
4141 let h1 = client. add_bytes ( b"test" . to_vec ( ) ) . await ?;
42- let protected: Arc < Mutex < Vec < Hash > > > = Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ;
43- let protected2 = protected. clone ( ) ;
44- blobs. add_protected ( Box :: new ( move |x| {
45- let protected = protected2. clone ( ) ;
46- Box :: pin ( async move {
47- let protected = protected. lock ( ) . unwrap ( ) ;
48- for h in protected. as_slice ( ) {
49- x. insert ( * h) ;
50- }
51- } )
42+ blobs. add_protected ( Box :: new ( {
43+ let protected = protected. clone ( ) ;
44+ move |x| {
45+ let protected = protected. clone ( ) ;
46+ Box :: pin ( async move {
47+ let protected = protected. lock ( ) . unwrap ( ) ;
48+ for h in protected. as_slice ( ) {
49+ x. insert ( * h) ;
50+ }
51+ } )
52+ }
5253 } ) ) ?;
5354 blobs. start_gc ( GcConfig {
5455 period : Duration :: from_millis ( 1 ) ,
You can’t perform that action at this time.
0 commit comments