Skip to content

Commit

Permalink
replace tempdir with tempfile, as tempdir is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkjall authored and yodaldevoid committed Mar 29, 2023
1 parent 875374a commit d9a1dfa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ libssh2-sys = { path = "libssh2-sys", version = "0.3.0" }
parking_lot = "0.11"

[dev-dependencies]
tempdir = "0.3"
tempfile = "3"

[workspace]
members = ['systest']
2 changes: 1 addition & 1 deletion tests/all/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![deny(warnings)]

extern crate ssh2;
extern crate tempdir;
extern crate tempfile;

use std::env;
use std::net::TcpStream;
Expand Down
4 changes: 2 additions & 2 deletions tests/all/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::env;
use std::fs::File;
use std::io::{self, prelude::*};
use std::path::Path;
use tempdir::TempDir;
use tempfile::TempDir;

use ssh2::{BlockDirections, HashType, KeyboardInteractivePrompt, MethodType, Prompt, Session};

Expand Down Expand Up @@ -163,7 +163,7 @@ fn scp_recv() {

#[test]
fn scp_send() {
let td = TempDir::new("test").unwrap();
let td = TempDir::new().unwrap();
let sess = ::authed_session();
let mut ch = sess
.scp_send(&td.path().join("foo"), 0o644, 6, None)
Expand Down
6 changes: 3 additions & 3 deletions tests/all/sftp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fs::{self, File};
use std::io::prelude::*;
use tempdir::TempDir;
use tempfile::TempDir;

#[test]
fn smoke() {
Expand All @@ -10,7 +10,7 @@ fn smoke() {

#[test]
fn ops() {
let td = TempDir::new("foo").unwrap();
let td = TempDir::new().unwrap();
File::create(&td.path().join("foo")).unwrap();
fs::create_dir(&td.path().join("bar")).unwrap();

Expand Down Expand Up @@ -53,7 +53,7 @@ fn ops() {

#[test]
fn not_found() {
let td = TempDir::new("foo").unwrap();
let td = TempDir::new().unwrap();

let sess = ::authed_session();
let sftp = sess.sftp().unwrap();
Expand Down

0 comments on commit d9a1dfa

Please sign in to comment.