Skip to content

Commit

Permalink
Merge pull request #710 from decathorpe/main
Browse files Browse the repository at this point in the history
chore: move from tempdir to tempfile
  • Loading branch information
nullr0ute authored Jan 9, 2025
2 parents 7a0ecf2 + dcfc3ec commit 8ee05ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 78 deletions.
86 changes: 12 additions & 74 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion manufacturing-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hex = "0.4"
serde_yaml = "0.9"
tar = "0.4.41"
flate2 = "1.0.31"
tempdir = "0.3.7"
tempfile = "3"

fdo-data-formats = { path = "../data-formats", version = "0.5.1" }
fdo-http-wrapper = { path = "../http-wrapper", version = "0.5.1", features = ["server"] }
Expand Down
6 changes: 3 additions & 3 deletions manufacturing-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use openssl::{
x509::X509,
};
use serde_yaml::Value;
use tempdir::TempDir;
use tempfile::TempDir;
use tokio::signal::unix::{signal, SignalKind};
use warp::reply::Response;

Expand Down Expand Up @@ -337,13 +337,13 @@ async fn main() -> Result<()> {
*res.status_mut() = warp::http::StatusCode::NOT_FOUND;
return res;
}
let tmp_dir = TempDir::new("manufacturer-server-ovs").unwrap();
let tmp_dir = TempDir::with_prefix("manufacturer-server-ovs").unwrap();
for ov in ovs {
let file_path = tmp_dir.path().join(ov.header().guid().to_string());
let tmp_file = File::create(file_path).unwrap();
OwnershipVoucher::serialize_to_writer(&ov, &tmp_file).unwrap();
}
let tmp_dir_archive = TempDir::new("manufacturer-server-ovs-archive").unwrap();
let tmp_dir_archive = TempDir::with_prefix("manufacturer-server-ovs-archive").unwrap();
let tar_gz = File::create(tmp_dir_archive.path().join("ovs.tar.gz")).unwrap();
let mut tar = tar::Builder::new(tar_gz);
tar.append_dir_all(".", tmp_dir).unwrap();
Expand Down

0 comments on commit 8ee05ed

Please sign in to comment.