summaryrefslogtreecommitdiff
path: root/cli/tools/installer.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-12-04 14:19:06 +0100
committerGitHub <noreply@github.com>2021-12-04 14:19:06 +0100
commitc59f90d01f06f995e335c6de76aab0b9ba2c98e5 (patch)
tree760bc0534fca502175749d9a7b719c0666f90543 /cli/tools/installer.rs
parent72e9720e91630bdf28b1660c20c67baa39bdb586 (diff)
chore: upgrade to Rust 1.57.0 (#12968)
Diffstat (limited to 'cli/tools/installer.rs')
-rw-r--r--cli/tools/installer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs
index a426fea0f..252939f85 100644
--- a/cli/tools/installer.rs
+++ b/cli/tools/installer.rs
@@ -137,7 +137,7 @@ pub fn infer_name_from_url(url: &Url) -> Option<String> {
stem = parent_name.to_string_lossy().to_string();
}
}
- let stem = stem.splitn(2, '@').next().unwrap().to_string();
+ let stem = stem.split_once('@').map_or(&*stem, |x| x.0).to_string();
Some(stem)
}