Skip to content

Commit 435ed0d

Browse files
committed
Add docs specifying toolchain_sort's expected behavior
1 parent cc58a41 commit 435ed0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/toolchain/names.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ impl Display for ToolchainName {
308308
}
309309
}
310310

311+
/// Sorts [`ToolchainName`]s in the following order:
312+
/// 1. `stable`/`beta`/`nightly`-prefixed names, in this exact order.
313+
/// 2. `X.Y.Z-suffix` names, sorted by semver rules on `X.Y.Z`, then by `suffix`.
314+
/// 3. Other names, sorted alphanumerically.
311315
pub(crate) fn toolchain_sort(v: &mut [ToolchainName]) {
312316
use semver::Version;
313317

0 commit comments

Comments
 (0)