@@ -139,8 +139,9 @@ fn bench_instance(c: &mut Criterion) {
139139fn  bench_cache ( c :  & mut  Criterion )  { 
140140    let  mut  group = c. benchmark_group ( "Cache" ) ; 
141141
142+     let  temp_dir = TempDir :: new ( ) . unwrap ( ) ; 
142143    let  options = CacheOptions :: new ( 
143-         TempDir :: new ( ) . unwrap ( ) . into_path ( ) , 
144+         temp_dir . path ( ) . to_path_buf ( ) , 
144145        capabilities_from_csv ( DEFAULT_CAPABILITIES ) , 
145146        MEMORY_CACHE_SIZE , 
146147        DEFAULT_MEMORY_LIMIT , 
@@ -194,9 +195,10 @@ fn bench_cache(c: &mut Criterion) {
194195        } ) ; 
195196    } 
196197
198+     let  temp_dir = TempDir :: new ( ) . unwrap ( ) ; 
197199    group. bench_function ( "instantiate from fs" ,  |b| { 
198200        let  non_memcache = CacheOptions :: new ( 
199-             TempDir :: new ( ) . unwrap ( ) . into_path ( ) , 
201+             temp_dir . path ( ) . to_path_buf ( ) , 
200202            capabilities_from_csv ( DEFAULT_CAPABILITIES ) , 
201203            Size :: new ( 0 ) , 
202204            DEFAULT_MEMORY_LIMIT , 
@@ -216,9 +218,10 @@ fn bench_cache(c: &mut Criterion) {
216218        } ) ; 
217219    } ) ; 
218220
221+     let  temp_dir = TempDir :: new ( ) . unwrap ( ) ; 
219222    group. bench_function ( "instantiate from fs unchecked" ,  |b| { 
220223        let  non_memcache = CacheOptions :: new ( 
221-             TempDir :: new ( ) . unwrap ( ) . into_path ( ) , 
224+             temp_dir . path ( ) . to_path_buf ( ) , 
222225            capabilities_from_csv ( DEFAULT_CAPABILITIES ) , 
223226            Size :: new ( 0 ) , 
224227            DEFAULT_MEMORY_LIMIT , 
@@ -283,9 +286,10 @@ fn bench_cache(c: &mut Criterion) {
283286} 
284287
285288fn  bench_instance_threads ( c :  & mut  Criterion )  { 
289+     let  temp_dir = TempDir :: new ( ) . unwrap ( ) ; 
286290    c. bench_function ( "multi-threaded get_instance" ,  |b| { 
287291        let  options = CacheOptions :: new ( 
288-             TempDir :: new ( ) . unwrap ( ) . into_path ( ) , 
292+             temp_dir . path ( ) . to_path_buf ( ) , 
289293            capabilities_from_csv ( DEFAULT_CAPABILITIES ) , 
290294            MEMORY_CACHE_SIZE , 
291295            DEFAULT_MEMORY_LIMIT , 
@@ -370,8 +374,9 @@ fn bench_instance_threads(c: &mut Criterion) {
370374fn  bench_combined ( c :  & mut  Criterion )  { 
371375    let  mut  group = c. benchmark_group ( "Combined" ) ; 
372376
377+     let  temp_dir = TempDir :: new ( ) . unwrap ( ) ; 
373378    let  options = CacheOptions :: new ( 
374-         TempDir :: new ( ) . unwrap ( ) . into_path ( ) , 
379+         temp_dir . path ( ) . to_path_buf ( ) , 
375380        capabilities_from_csv ( "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,iterator,staking" ) , 
376381        MEMORY_CACHE_SIZE , 
377382        DEFAULT_MEMORY_LIMIT , 
0 commit comments