aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-31 11:49:06 +0100
committerAleksey Kladov <[email protected]>2020-05-31 11:49:06 +0100
commit13a996f3b68c175f6e6ad8d89081e45850dc5583 (patch)
tree4f4c4cfc1302fc57caadd42af4670404c6f98f4d
parent7e3ee77c83dc4e9af470491046206bf46d2a9a7e (diff)
Force / slashes on windows
-rw-r--r--xtask/src/codegen/gen_feature_docs.rs5
1 files 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 {
70impl fmt::Display for Feature { 70impl fmt::Display for Feature {
71 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 71 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
72 writeln!(f, "=== {}", self.id)?; 72 writeln!(f, "=== {}", self.id)?;
73 let path = self.path.strip_prefix(&project_root()).unwrap(); 73 let path = self.path.strip_prefix(&project_root()).unwrap().display().to_string();
74 let path = path.replace('\\', "/");
74 let name = self.path.file_name().unwrap(); 75 let name = self.path.file_name().unwrap();
75 76
76 //FIXME: generate line number as well 77 //FIXME: generate line number as well
77 writeln!( 78 writeln!(
78 f, 79 f,
79 "**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/{}[{}]", 80 "**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/{}[{}]",
80 path.display(), 81 path,
81 name.to_str().unwrap(), 82 name.to_str().unwrap(),
82 )?; 83 )?;
83 84