Skip to content

switch from tempdir to tempfile #859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ optional = true
[dev-dependencies]
femme = "1.3.0"
rand = "0.7.3"
tempdir = "0.3.7"
tempfile = "3.1.0"
futures = "0.3.4"
rand_xorshift = "0.2.0"

Expand Down
12 changes: 8 additions & 4 deletions tests/uds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use async_std::os::unix::net::{UnixDatagram, UnixListener, UnixStream};
use async_std::prelude::*;
use async_std::task;

use tempdir::TempDir;

use std::time::Duration;

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

#[test]
fn socket_ping_pong() {
let tmp_dir = TempDir::new("socket_ping_pong").expect("Temp dir not created");
let tmp_dir = tempfile::Builder::new()
.prefix("socket_ping_pong")
.tempdir()
.expect("Temp dir not created");
let sock_path = tmp_dir.as_ref().join("sock");
let iter_cnt = 16;

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

Expand Down