From bbff317aa7b183ce58a52df35d58997f2203c8d7 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 --- src/api2/node/disks/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api2/node/disks/mod.rs b/src/api2/node/disks/mod.rs index 44554157..e0c3d39c 100644 --- a/src/api2/node/disks/mod.rs +++ b/src/api2/node/disks/mod.rs @@ -66,6 +66,8 @@ pub fn list_disks( } } + list.sort_by(|a, b| a.name.cmp(&b.name)); + Ok(list) }