Skip to content

Commit

Permalink
Run cargo fmt on the project
Browse files Browse the repository at this point in the history
  • Loading branch information
vlovich committed Apr 23, 2021
1 parent 2fdd28c commit 377dc0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,11 @@ fn path_push(path: &mut String, p: &str) {
if has_unix_root(p) || has_windows_root(p) {
*path = p.to_string();
} else {
let dir_separator = if has_windows_root(path.as_str()) { '\\' } else { '/' };
let dir_separator = if has_windows_root(path.as_str()) {
'\\'
} else {
'/'
};

if !path.ends_with(dir_separator) {
path.push(dir_separator);
Expand All @@ -911,8 +915,7 @@ fn has_unix_root(p: &str) -> bool {

/// Check if the path in the given string has a windows style root
fn has_windows_root(p: &str) -> bool {
p.starts_with('\\')
|| p.get(1..3) == Some(":\\")
p.starts_with('\\') || p.get(1..3) == Some(":\\")
}

fn name_attr<R>(
Expand Down

0 comments on commit 377dc0f

Please sign in to comment.