From 0b530cc257e33e9801804b73ed831a1f28489b57 Mon Sep 17 00:00:00 2001 From: Gal Schlezinger Date: Wed, 29 May 2024 18:09:14 +0300 Subject: [PATCH] fix ordering, closes #1135 (#1148) * fix ordering, closes #1135 * add changeset * don't change the command signature --- .changeset/good-squids-bathe.md | 5 +++++ src/commands/ls_remote.rs | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/good-squids-bathe.md diff --git a/.changeset/good-squids-bathe.md b/.changeset/good-squids-bathe.md new file mode 100644 index 000000000..a9dfcde7b --- /dev/null +++ b/.changeset/good-squids-bathe.md @@ -0,0 +1,5 @@ +--- +"fnm": patch +--- + +fix ordering in ls-remote diff --git a/src/commands/ls_remote.rs b/src/commands/ls_remote.rs index 32f744931..d32c9898a 100644 --- a/src/commands/ls_remote.rs +++ b/src/commands/ls_remote.rs @@ -57,10 +57,9 @@ impl super::command::Command for LsRemote { } if self.latest { - all_versions.truncate(1); + all_versions.drain(0..all_versions.len() - 1); } - all_versions.sort_by_key(|v| v.version.clone()); if let SortingMethod::Descending = self.sort { all_versions.reverse(); }