ensure desc sort and cleanup unused imports

This commit is contained in:
KCaverly 2023-09-26 09:53:49 -04:00
parent 86ec0b1d9f
commit ea278b5b12

View File

@ -16,19 +16,19 @@ use rpc::proto::Timestamp;
use rusqlite::params;
use rusqlite::types::Value;
use std::{
cmp::Reverse,
future::Future,
ops::Range,
path::{Path, PathBuf},
rc::Rc,
sync::Arc,
time::{Instant, SystemTime},
time::SystemTime,
};
use util::TryFutureExt;
pub fn argsort<T: Ord>(data: &[T]) -> Vec<usize> {
let mut indices = (0..data.len()).collect::<Vec<_>>();
indices.sort_by_key(|&i| &data[i]);
indices.reverse();
indices
}