track-core 0.1.0

Shared backend primitives and repositories for the track issue tracker.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::types::Task;

pub fn sort_tasks(tasks: &[Task]) -> Vec<Task> {
    let mut sorted = tasks.to_vec();
    sorted.sort_by(|left, right| {
        left.status
            .cmp(&right.status)
            .then_with(|| left.priority.cmp(&right.priority))
            .then_with(|| right.created_at.cmp(&left.created_at))
    });
    sorted
}