mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 12:25:05 +00:00
Force / slashes on windows
This commit is contained in:
parent
7e3ee77c83
commit
13a996f3b6
1 changed files with 3 additions and 2 deletions
|
@ -70,14 +70,15 @@ fn is_valid_feature_name(feature: &str) -> bool {
|
||||||
impl fmt::Display for Feature {
|
impl fmt::Display for Feature {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
writeln!(f, "=== {}", self.id)?;
|
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();
|
let name = self.path.file_name().unwrap();
|
||||||
|
|
||||||
//FIXME: generate line number as well
|
//FIXME: generate line number as well
|
||||||
writeln!(
|
writeln!(
|
||||||
f,
|
f,
|
||||||
"**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/{}[{}]",
|
"**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/{}[{}]",
|
||||||
path.display(),
|
path,
|
||||||
name.to_str().unwrap(),
|
name.to_str().unwrap(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue