Skip to content

Commit ad58e54

Browse files
committed
handle unsafe set_var call
1 parent e42cf0e commit ad58e54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test_utils/insta.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ macro_rules! assert_snapshot {
1212
}
1313

1414
pub fn settings() -> insta::Settings {
15-
env::set_var("INSTA_WORKSPACE_ROOT", env!("CARGO_MANIFEST_DIR"));
15+
// Safety: this is only used in tests, it may panic if used in parallel with other tests.
16+
unsafe { env::set_var("INSTA_WORKSPACE_ROOT", env!("CARGO_MANIFEST_DIR")) };
1617
let mut settings = insta::Settings::clone_current();
1718
let cwd = env::current_dir().unwrap();
1819
let cwd = cwd.to_str().unwrap();

0 commit comments

Comments
 (0)