From dac877252b551edd5ee333c668440047c6729b2b Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Fri, 9 Jul 2021 12:32:35 +0200 Subject: [PATCH] api: disk list: sort by name So callers get more stable results. Most noticeable, the disk list in the web UI doesn't jump around upon reloading, and while sorting could be done directly there, like this other callers get the benefit too. Signed-off-by: Fabian Ebner (cherry picked from commit bbff317aa7b183ce58a52df35d58997f2203c8d7) Signed-off-by: Thomas Lamprecht --- src/api2/node/disks.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api2/node/disks.rs b/src/api2/node/disks.rs index 44554157..e0c3d39c 100644 --- a/src/api2/node/disks.rs +++ b/src/api2/node/disks.rs @@ -66,6 +66,8 @@ pub fn list_disks( } } + list.sort_by(|a, b| a.name.cmp(&b.name)); + Ok(list) }