Skip to content

Commit

Permalink
replace tempdir with tempfile (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-seppanen authored Dec 20, 2024
1 parent ad56a8e commit 242b1e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion russh-keys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ pageant = { version = "0.0.1-beta.3", path = "../pageant" }

[dev-dependencies]
env_logger = "0.11"
tempdir = "0.3"
tempfile = "3.14.0"
tokio = { workspace = true, features = ["test-util", "macros", "process"] }
2 changes: 1 addition & 1 deletion russh-keys/src/known_hosts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ mod test {
#[test]
fn test_check_known_hosts() {
env_logger::try_init().unwrap_or(());
let dir = tempdir::TempDir::new("russh").unwrap();
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join("known_hosts");
{
let mut f = File::create(&path).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions russh-keys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! #[cfg(unix)]
//! fn main() {
//! env_logger::try_init().unwrap_or(());
//! let dir = tempdir::TempDir::new("russh").unwrap();
//! let dir = tempfile::tempdir().unwrap();
//! let agent_path = dir.path().join("agent");
//!
//! let mut core = tokio::runtime::Runtime::new().unwrap();
Expand Down Expand Up @@ -834,7 +834,7 @@ Cog3JMeTrb3LiPHgN6gU2P30MRp6L1j1J/MtlOAr5rux
env_logger::try_init().unwrap_or(());
use std::process::Stdio;

let dir = tempdir::TempDir::new("russh")?;
let dir = tempfile::tempdir()?;
let agent_path = dir.path().join("agent");
let mut agent = tokio::process::Command::new("ssh-agent")
.arg("-a")
Expand Down Expand Up @@ -901,7 +901,7 @@ Cog3JMeTrb3LiPHgN6gU2P30MRp6L1j1J/MtlOAr5rux
#[cfg(unix)]
fn test_agent() {
env_logger::try_init().unwrap_or(());
let dir = tempdir::TempDir::new("russh").unwrap();
let dir = tempfile::tempdir().unwrap();
let agent_path = dir.path().join("agent");

let core = tokio::runtime::Runtime::new().unwrap();
Expand Down

0 comments on commit 242b1e1

Please sign in to comment.