Skip to content

Commit 4bc6aa6

Browse files
authored
Merge pull request #1689 from felixfontein/rust
Update Rust dependencies
2 parents 05b10a6 + 981c21a commit 4bc6aa6

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

functional-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
authors = ["Adrian Utrilla <[email protected]>"]
66

77
[dependencies]
8-
tempdir = "0.3.5"
8+
tempfile = "3.12.0"
99
serde = "1.0"
1010
serde_json = "1.0.133"
1111
serde_yaml = "0.9.34"

functional-tests/src/lib.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
#[cfg_attr(test, macro_use)]
2+
extern crate lazy_static;
13
extern crate serde;
24
extern crate serde_json;
35
extern crate serde_yaml;
4-
extern crate tempdir;
5-
#[macro_use]
6-
extern crate lazy_static;
7-
#[macro_use]
8-
extern crate serde_derive;
6+
extern crate tempfile;
97

108
#[cfg(test)]
119
mod tests {
@@ -19,7 +17,8 @@ mod tests {
1917
use std::io::{Read, Write};
2018
use std::path::Path;
2119
use std::process::Command;
22-
use tempdir::TempDir;
20+
use tempfile::Builder;
21+
use tempfile::TempDir;
2322
const SOPS_BINARY_PATH: &'static str = "./sops";
2423
const KMS_KEY: &'static str = "FUNCTIONAL_TEST_KMS_ARN";
2524

@@ -36,8 +35,10 @@ mod tests {
3635
}
3736

3837
lazy_static! {
39-
static ref TMP_DIR: TempDir =
40-
TempDir::new("sops-functional-tests").expect("Unable to create temporary directory");
38+
static ref TMP_DIR: TempDir = Builder::new()
39+
.prefix("sops-functional-tests")
40+
.tempdir()
41+
.expect("Unable to create temporary directory");
4142
}
4243

4344
fn prepare_temp_file(name: &str, contents: &[u8]) -> String {
@@ -806,7 +807,7 @@ b: ba"#
806807
let file_path = "res/comments.yaml";
807808
let output = Command::new(SOPS_BINARY_PATH)
808809
.arg("encrypt")
809-
.arg(file_path.clone())
810+
.arg(file_path)
810811
.output()
811812
.expect("Error running sops");
812813
assert!(output.status.success(), "SOPS didn't return successfully");
@@ -825,7 +826,7 @@ b: ba"#
825826
let file_path = "res/comments_list.yaml";
826827
let output = Command::new(SOPS_BINARY_PATH)
827828
.arg("encrypt")
828-
.arg(file_path.clone())
829+
.arg(file_path)
829830
.output()
830831
.expect("Error running sops");
831832
assert!(output.status.success(), "SOPS didn't return successfully");
@@ -844,7 +845,7 @@ b: ba"#
844845
let file_path = "res/comments.enc.yaml";
845846
let output = Command::new(SOPS_BINARY_PATH)
846847
.arg("decrypt")
847-
.arg(file_path.clone())
848+
.arg(file_path)
848849
.output()
849850
.expect("Error running sops");
850851
assert!(output.status.success(), "SOPS didn't return successfully");
@@ -863,7 +864,7 @@ b: ba"#
863864
let file_path = "res/comments_unencrypted_comments.yaml";
864865
let output = Command::new(SOPS_BINARY_PATH)
865866
.arg("decrypt")
866-
.arg(file_path.clone())
867+
.arg(file_path)
867868
.output()
868869
.expect("Error running sops");
869870
assert!(output.status.success(), "SOPS didn't return successfully");

0 commit comments

Comments
 (0)