Skip to content

Commit ddd8570

Browse files
authored
Merge pull request #5576 from nymtech/max/update-surb-example-tempdir2
Rust SDK SURB example: change hardcoded file to tempdir
2 parents 17860c8 + d45d1eb commit ddd8570

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/rust/nym-sdk/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ tap = { workspace = true }
5858
thiserror = { workspace = true }
5959
url = { workspace = true }
6060
toml = { workspace = true }
61+
tempfile = { workspace = true }
6162

6263
# tcpproxy dependencies
6364
clap = { workspace = true, features = ["derive"] }

sdk/rust/nym-sdk/examples/surb_reply.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ use nym_sdk::mixnet::{
33
StoragePaths,
44
};
55
use std::path::PathBuf;
6+
use tempfile::TempDir;
67

78
#[tokio::main]
89
async fn main() {
910
nym_bin_common::logging::setup_logging();
1011

1112
// Specify some config options
12-
let config_dir = PathBuf::from("/tmp/surb-example");
13+
let config_dir: PathBuf = TempDir::new().unwrap().path().to_path_buf();
1314
let storage_paths = StoragePaths::new_from_dir(&config_dir).unwrap();
1415

1516
// Create the client with a storage backend, and enable it by giving it some paths. If keys

0 commit comments

Comments
 (0)