diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-11 17:32:03 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-11 23:02:17 +0100 |
| commit | 5c8de1cf4971e5800e2dd33393eef7ad7b8b78be (patch) | |
| tree | 6fafbe7b8aee0a32ad31c5514cd89e82bcd6ee23 /src/bootstrap | |
| parent | 2225ee1b62ff089917434aefd9b2bf509cfa087f (diff) | |
| download | rust-5c8de1cf4971e5800e2dd33393eef7ad7b8b78be.tar.gz rust-5c8de1cf4971e5800e2dd33393eef7ad7b8b78be.zip | |
use strip_prefix over slicing (clippy::manual_strip)
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/dist.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 354be109cf2..360e51ed2bb 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1186,7 +1186,7 @@ pub fn sanitize_sh(path: &Path) -> String { return change_drive(unc_to_lfs(&path)).unwrap_or(path); fn unc_to_lfs(s: &str) -> &str { - if s.starts_with("//?/") { &s[4..] } else { s } + s.strip_prefix("//?/").unwrap_or(s) } fn change_drive(s: &str) -> Option<String> { |
