Skip to content

Commit cc1c96f

Browse files
committed
switch from tempdir to tempfile
Uses a more recent version of rand Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent dbc98fa commit cc1c96f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ optional = true
102102
[dev-dependencies]
103103
femme = "1.3.0"
104104
rand = "0.7.3"
105-
tempdir = "0.3.7"
105+
tempfile = "3.1.0"
106106
futures = "0.3.4"
107107
rand_xorshift = "0.2.0"
108108

Diff for: tests/uds.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use async_std::os::unix::net::{UnixDatagram, UnixListener, UnixStream};
55
use async_std::prelude::*;
66
use async_std::task;
77

8-
use tempdir::TempDir;
9-
108
use std::time::Duration;
119

1210
const JULIUS_CAESAR: &[u8] = b"
@@ -51,7 +49,7 @@ const TEST_TIMEOUT: Duration = Duration::from_secs(3);
5149

5250
#[test]
5351
fn socket_ping_pong() {
54-
let tmp_dir = TempDir::new("socket_ping_pong").expect("Temp dir not created");
52+
let tmp_dir = tempfile::Builder::new().prefix("socket_ping_pong").tempdir().expect("Temp dir not created");
5553
let sock_path = tmp_dir.as_ref().join("sock");
5654
let iter_cnt = 16;
5755

@@ -98,7 +96,7 @@ async fn ping_pong_client(socket: &std::path::PathBuf, iterations: u32) -> std::
9896
#[test]
9997
fn uds_clone() -> io::Result<()> {
10098
task::block_on(async {
101-
let tmp_dir = TempDir::new("socket_ping_pong").expect("Temp dir not created");
99+
let tmp_dir = tempfile::Builder::new().prefix("socket_ping_pong").tempdir().expect("Temp dir not created");
102100
let sock_path = tmp_dir.as_ref().join("sock");
103101
let input = UnixListener::bind(&sock_path).await?;
104102

0 commit comments

Comments
 (0)