mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 03:44:19 +01:00
Typo: delimitor -> delimiter
This commit is contained in:
parent
913339fb63
commit
4e51c69bfe
@ -101,7 +101,7 @@ fn test_usage_for_pwd_per_drive() {
|
|||||||
expanded,
|
expanded,
|
||||||
Some(PathBuf::from(format!(
|
Some(PathBuf::from(format!(
|
||||||
"{}test",
|
"{}test",
|
||||||
DriveToPwdMap::ensure_trailing_delimitor(&sys_abs)
|
DriveToPwdMap::ensure_trailing_delimiter(&sys_abs)
|
||||||
)))
|
)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ impl DriveToPwdMap {
|
|||||||
if let Some(drive_letter) = Self::extract_drive_letter(path) {
|
if let Some(drive_letter) = Self::extract_drive_letter(path) {
|
||||||
if let Ok(pwd) = self.get_pwd(drive_letter) {
|
if let Ok(pwd) = self.get_pwd(drive_letter) {
|
||||||
// Combine current PWD with the relative path
|
// Combine current PWD with the relative path
|
||||||
let mut base = PathBuf::from(Self::ensure_trailing_delimitor(&pwd));
|
let mut base = PathBuf::from(Self::ensure_trailing_delimiter(&pwd));
|
||||||
base.push(path_str.split_at(2).1); // Skip the "C:" part of the relative path
|
base.push(path_str.split_at(2).1); // Skip the "C:" part of the relative path
|
||||||
return Some(base);
|
return Some(base);
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ impl DriveToPwdMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Ensure a path has a trailing `\`
|
/// Ensure a path has a trailing `\`
|
||||||
fn ensure_trailing_delimitor(path: &str) -> String {
|
fn ensure_trailing_delimiter(path: &str) -> String {
|
||||||
if !path.ends_with('\\') && !path.ends_with('/') {
|
if !path.ends_with('\\') && !path.ends_with('/') {
|
||||||
format!(r"{}\", path)
|
format!(r"{}\", path)
|
||||||
} else {
|
} else {
|
||||||
@ -284,7 +284,7 @@ mod tests {
|
|||||||
expanded,
|
expanded,
|
||||||
Some(PathBuf::from(format!(
|
Some(PathBuf::from(format!(
|
||||||
r"{}test",
|
r"{}test",
|
||||||
DriveToPwdMap::ensure_trailing_delimitor(&pwd_on_d)
|
DriveToPwdMap::ensure_trailing_delimiter(&pwd_on_d)
|
||||||
)))
|
)))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user