From 13a996f3b68c175f6e6ad8d89081e45850dc5583 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 31 May 2020 12:49:06 +0200 Subject: Force / slashes on windows --- xtask/src/codegen/gen_feature_docs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xtask/src/codegen/gen_feature_docs.rs b/xtask/src/codegen/gen_feature_docs.rs index a6f339e7b..dbe583e8e 100644 --- a/xtask/src/codegen/gen_feature_docs.rs +++ b/xtask/src/codegen/gen_feature_docs.rs @@ -70,14 +70,15 @@ fn is_valid_feature_name(feature: &str) -> bool { impl fmt::Display for Feature { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!(f, "=== {}", self.id)?; - let path = self.path.strip_prefix(&project_root()).unwrap(); + let path = self.path.strip_prefix(&project_root()).unwrap().display().to_string(); + let path = path.replace('\\', "/"); let name = self.path.file_name().unwrap(); //FIXME: generate line number as well writeln!( f, "**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/{}[{}]", - path.display(), + path, name.to_str().unwrap(), )?; -- cgit v1.2.3