Skip to content

Commit 479f45d

Browse files
committed
test_dir is a str anyway
1 parent 140c4e4 commit 479f45d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::{
22
env::{self, consts::EXE_SUFFIX},
3-
fs,
43
process::{Command, Stdio},
54
str::from_utf8,
65
};
@@ -156,7 +155,6 @@ fn hint() {
156155
#[test]
157156
fn init() {
158157
let test_dir = tempfile::TempDir::new().unwrap();
159-
let initialized_dir = test_dir.path().join("rustlings");
160158
let test_dir = test_dir.path().to_str().unwrap();
161159

162160
Cmd::default().current_dir(test_dir).fail();
@@ -173,9 +171,11 @@ fn init() {
173171
.output(PartialStderr("`cd rustlings`"))
174172
.fail();
175173

174+
let initialized_dir = format!("{test_dir}/rustlings");
175+
176176
// Running `init` in the initialized directory.
177177
Cmd::default()
178-
.current_dir(initialized_dir.to_str().unwrap())
178+
.current_dir(&initialized_dir)
179179
.args(&["init"])
180180
.output(PartialStderr("already initialized"))
181181
.fail();

0 commit comments

Comments
 (0)