From da799ea508566cd5dcfe0c4501910e37aead21cb Mon Sep 17 00:00:00 2001 From: Jon Jensen Date: Thu, 9 Jun 2022 13:47:37 -0600 Subject: [PATCH] Little exactness tweaks (#1874) * Correct Windows paths \\ is only for the beginning of UNC paths, e.g. \\host-name\share-name\file-path as per https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file * Remove spaces path list using brace expansion In the shell, spaces are significant in a path with brace expansion, and break it. (As opposed to in Rust module brace expansion.) --- src/cmd/serve.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/serve.rs b/src/cmd/serve.rs index 78180710a7..dd4a4b446f 100644 --- a/src/cmd/serve.rs +++ b/src/cmd/serve.rs @@ -419,7 +419,7 @@ pub fn serve( broadcaster }; - println!("Listening for changes in {}{{{}}}", root_dir.display(), watchers.join(", ")); + println!("Listening for changes in {}{{{}}}", root_dir.display(), watchers.join(",")); println!("Press Ctrl+C to stop\n"); // Delete the output folder on ctrl+C @@ -764,9 +764,9 @@ mod tests { #[cfg(windows)] fn windows_path_handling() { let expected = (ChangeKind::Templates, PathBuf::from("/templates/hello.html")); - let pwd = Path::new(r#"C:\\Users\johan\site"#); - let path = Path::new(r#"C:\\Users\johan\site\templates\hello.html"#); - let config_filename = Path::new(r#"C:\\Users\johan\site\config.toml"#); + let pwd = Path::new(r#"C:\Users\johan\site"#); + let path = Path::new(r#"C:\Users\johan\site\templates\hello.html"#); + let config_filename = Path::new(r#"C:\Users\johan\site\config.toml"#); assert_eq!(expected, detect_change_kind(pwd, path, config_filename)); }