From 0850d82710acb2c82218de81d5079b3ef13e9060 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 16 Dec 2020 10:07:16 +0100 Subject: [PATCH] Fix clippy suggestion --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 98fb0a2..a19894a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -use std::cmp::{max, min, Ordering}; +use std::cmp::{max, min, Ordering, Reverse}; use std::hash::Hash; use std::ops::Index; @@ -54,7 +54,7 @@ where let mut nodes = (0..points.len()) .map(|i| (LayerId::random(&mut rng), i)) .collect::>(); - nodes.sort_unstable_by(|l, r| r.cmp(&l)); + nodes.sort_unstable_by_key(|&n| Reverse(n)); // Sort the original `points` in layer order. // TODO: maybe optimize this? https://crates.io/crates/permutation