Skip to content

Commit a9dae71

Browse files
author
fmoko
authored
Merge pull request #574 from jrvidal/temp_file
fix: more unique temp_file
2 parents dd84cc5 + 5643ef0 commit a9dae71

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/exercise.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ const I_AM_DONE_REGEX: &str = r"(?m)^\s*///?\s*I\s+AM\s+NOT\s+DONE";
1111
const CONTEXT: usize = 2;
1212
const CLIPPY_CARGO_TOML_PATH: &str = "./exercises/clippy/Cargo.toml";
1313

14-
// Get a temporary file name that is hopefully unique to this process
14+
// Get a temporary file name that is hopefully unique
1515
#[inline]
1616
fn temp_file() -> String {
17-
format!("./temp_{}", process::id())
17+
let thread_id: String = format!("{:?}", std::thread::current().id())
18+
.chars()
19+
.filter(|c| c.is_alphanumeric())
20+
.collect();
21+
22+
format!("./temp_{}_{}", process::id(), thread_id)
1823
}
1924

2025
// The mode of the exercise.

0 commit comments

Comments
 (0)