File: 1002_tempfile.patch

package info (click to toggle)
rust-io-timer 0.0.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296 kB
  • sloc: makefile: 2; sh: 1
file content (37 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Description: use crate tempfile (not deprecated tempdir)
Author: Jonas Smedegaard <dr@jones.dk>
Bug: https://github.com/pimalaya/io-timer/issues/1
Last-Update: 2026-03-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@
 env_logger = "0.11"
 io-stream = { version = "0.0.2", default-features = false, features = ["std", "tokio"] }
 mock_instant = "0.6"
-tempdir = "0.3"
+tempfile = "3"
 tokio = { version = "1", features = ["full"] }
 
 [dependencies]
--- a/examples/tokio-unix.rs
+++ b/examples/tokio-unix.rs
@@ -11,7 +11,7 @@
     Timer,
 };
 use log::{debug, info, trace};
-use tempdir::TempDir;
+use tempfile::TempDir;
 use tokio::{
     net::{UnixListener, UnixStream},
     spawn,
@@ -34,7 +34,7 @@
 
     let socket = match env::var("SOCKET") {
         Ok(path) => PathBuf::from(path),
-        Err(_) => TempDir::new("timer").unwrap().into_path().join("socket"),
+        Err(_) => TempDir::with_prefix("timer").unwrap().path().join("socket"),
     };
 
     let timer = Arc::new(Mutex::new(Timer::new(TimerConfig {