Skip to content

Commit 01bc242

Browse files
committed
Inline semver::Version in toolchain_sort
1 parent 435ed0d commit 01bc242

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/toolchain/names.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ impl Display for ToolchainName {
313313
/// 2. `X.Y.Z-suffix` names, sorted by semver rules on `X.Y.Z`, then by `suffix`.
314314
/// 3. Other names, sorted alphanumerically.
315315
pub(crate) fn toolchain_sort(v: &mut [ToolchainName]) {
316-
use semver::Version;
317-
318316
v.sort_by_key(|name| {
319317
let s = name.to_string();
320318
if s.starts_with("stable") {
@@ -327,7 +325,7 @@ pub(crate) fn toolchain_sort(v: &mut [ToolchainName]) {
327325
return (2, None, s);
328326
}
329327
if let Some((ver_str, suffix)) = s.split_once('-') {
330-
if let Ok(ver) = Version::parse(ver_str) {
328+
if let Ok(ver) = semver::Version::parse(ver_str) {
331329
return (3, Some(ver), suffix.to_owned());
332330
}
333331
}

0 commit comments

Comments
 (0)