aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/worktree.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/worktree.rs b/src/worktree.rs
index 70391470..d345f337 100644
--- a/src/worktree.rs
+++ b/src/worktree.rs
@@ -529,11 +529,14 @@ prunable stale
#[cfg(windows)]
#[test]
fn windows_tilde_expansion_normalizes_separators() {
- let env = |key| match key {
- "HOME" => Some("~".into()),
- "USERPROFILE" => Some(r"C:\Users\herdr".into()),
- _ => None,
- };
+ fn env(key: &str) -> Option<OsString> {
+ match key {
+ "HOME" => Some("~".into()),
+ "USERPROFILE" => Some(r"C:\Users\herdr".into()),
+ _ => None,
+ }
+ }
+
let default_path = expand_tilde_path_from_env("~/.herdr/worktrees", true, env);
assert_eq!(
default_path,