@@ -182,8 +182,9 @@ fn bench_instance(c: &mut Criterion) {
182182fn bench_cache ( c : & mut Criterion ) {
183183 let mut group = c. benchmark_group ( "Cache" ) ;
184184
185+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
185186 let options = CacheOptions :: new (
186- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
187+ temp_dir . path ( ) ,
187188 capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
188189 MEMORY_CACHE_SIZE ,
189190 DEFAULT_MEMORY_LIMIT ,
@@ -237,9 +238,10 @@ fn bench_cache(c: &mut Criterion) {
237238 } ) ;
238239 }
239240
241+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
240242 group. bench_function ( "instantiate from fs" , |b| {
241243 let non_memcache = CacheOptions :: new (
242- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
244+ temp_dir . path ( ) ,
243245 capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
244246 Size :: new ( 0 ) ,
245247 DEFAULT_MEMORY_LIMIT ,
@@ -259,9 +261,10 @@ fn bench_cache(c: &mut Criterion) {
259261 } ) ;
260262 } ) ;
261263
264+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
262265 group. bench_function ( "instantiate from fs unchecked" , |b| {
263266 let non_memcache = CacheOptions :: new (
264- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
267+ temp_dir . path ( ) ,
265268 capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
266269 Size :: new ( 0 ) ,
267270 DEFAULT_MEMORY_LIMIT ,
@@ -326,9 +329,10 @@ fn bench_cache(c: &mut Criterion) {
326329}
327330
328331fn bench_instance_threads ( c : & mut Criterion ) {
332+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
329333 c. bench_function ( "multi-threaded get_instance" , |b| {
330334 let options = CacheOptions :: new (
331- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
335+ temp_dir . path ( ) ,
332336 capabilities_from_csv ( DEFAULT_CAPABILITIES ) ,
333337 MEMORY_CACHE_SIZE ,
334338 DEFAULT_MEMORY_LIMIT ,
@@ -413,8 +417,9 @@ fn bench_instance_threads(c: &mut Criterion) {
413417fn bench_combined ( c : & mut Criterion ) {
414418 let mut group = c. benchmark_group ( "Combined" ) ;
415419
420+ let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
416421 let options = CacheOptions :: new (
417- TempDir :: new ( ) . unwrap ( ) . into_path ( ) ,
422+ temp_dir . path ( ) ,
418423 capabilities_from_csv ( "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,iterator,staking" ) ,
419424 MEMORY_CACHE_SIZE ,
420425 DEFAULT_MEMORY_LIMIT ,
0 commit comments