mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-27 17:22:39 +01:00
feat: sort alias accounts descending and fixed sorting for csv batch (#573)
sort alias accounts descending and fixed sorting for csv batch (#573)
This commit is contained in:
@@ -527,9 +527,9 @@ pub async fn persist_source_config(
|
||||
{
|
||||
if let Some(aliases) = input.aliases.as_mut() {
|
||||
aliases.sort_by(|a, b| {
|
||||
let a_ts = a.exp_date.unwrap_or(i64::MAX);
|
||||
let b_ts = b.exp_date.unwrap_or(i64::MAX);
|
||||
a_ts.cmp(&b_ts).then_with(|| a.name.cmp(&b.name))
|
||||
let a_ts = a.exp_date.unwrap_or(i64::MIN);
|
||||
let b_ts = b.exp_date.unwrap_or(i64::MIN);
|
||||
b_ts.cmp(&a_ts).then_with(|| a.name.cmp(&b.name))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user