Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Merge #209
Browse files Browse the repository at this point in the history
209: make --shorten-paths format more cross platform r=jonas-schievink a=japaric

use `std::path::MAIN_SEPARATOR` instead of `/`

Co-authored-by: Jorge Aparicio <[email protected]>
  • Loading branch information
bors[bot] and japaric authored May 19, 2021
2 parents 34c8fda + 4269997 commit a990401
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
use std::path::Path;
use std::path::{self, Path};

pub(crate) fn shorten_paths(path: &Path) -> String {
if let Some(dep) = Dependency::from_path(path) {
format!("[{}]/{}", dep.name_version, dep.path.display())
format!(
"[{}]{}{}",
dep.name_version,
path::MAIN_SEPARATOR,
dep.path.display()
)
} else {
path.display().to_string()
}
Expand Down

0 comments on commit a990401

Please sign in to comment.