nextaction-rs 0.2.1

Add nextaction tag to todoist obeying omnifocus' way
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::collections::BTreeSet;
use std::cmp::Ord;

pub trait RebuildInsertion<T> {
    fn rebuild_insert(&mut self, T) -> bool;
}

impl<T> RebuildInsertion<T> for BTreeSet<T>
    where T: Ord
{
    fn rebuild_insert(&mut self, value: T) -> bool {
        // this will make this insertion as if with a rebuild after inserting.
        let flag = self.remove(&value);
        self.insert(value);
        flag
    }
}