pub fn unschedule<'a>(&mut self, data: &'a D) -> Option<Entry<T, D>> {
        let when = self.remove_from_map(data);
        match (self.root.take(), when) {
            (Some(mut root), Some(when)) => match root {
                Node::Leaf { start, end, data } => {
                    self.root = None;
                    self.scope = None;
                    Some(Entry {
                        start,
                        end,
                        data: Rc::try_unwrap(data).expect("Internal error: rc was not 1"),
                    })
                }
                Node::Intermediate { .. } => {
                    let entry = root.unschedule(when, data).map(|(entry, scope)| {
                        self.scope = Some(scope);
                        Entry {
                            start: entry.start,
                            end: entry.end,
                            data: Rc::try_unwrap(entry.data).expect("Internal error: rc was not 1"),
                        }
                    });
                    self.root = Some(root);
                    entry
                }
            },
            _ => None,
        }
    }
/// Removes the given data from the schedule tree.
///
/// Returns the related entry from the tree if the tree contained it, otherwise None.
Removes the given data from the schedule tree.
Returns the related entry from the tree if the tree contained it, otherwise None.
Removes the given data from the schedule tree . Returns the related entry from the tree if the tree contained it otherwise None .
pub fn unschedule<'a>(&mut self, data: &'a D) -> Option<Entry<T, D>> {
        let when = self.remove_from_map(data);
        match (self.root.take(), when) {
            (Some(mut root), Some(when)) => match root {
                Node::Leaf { start, end, data } => {
                    self.root = None;
                    self.scope = None;
                    Some(Entry {
                        start,
                        end,
                        data: Rc::try_unwrap(data).expect("Internal error: rc was not 1"),
                    })
                }
                Node::Intermediate { .. } => {
                    let entry = root.unschedule(when, data).map(|(entry, scope)| {
                        self.scope = Some(scope);
                        Entry {
                            start: entry.start,
                            end: entry.end,
                            data: Rc::try_unwrap(entry.data).expect("Internal error: rc was not 1"),
                        }
                    });
                    self.root = Some(root);
                    entry
                }
            },
            _ => None,
        }
    }
pub fn unschedule < ' a > ( & mut self , data : & ' a D ) -> Option < Entry < T , D > > { let when = self . remove_from_map ( data ) ; match ( self . root . take ( ) , when ) { ( Some ( mut root ) , Some ( when ) ) => match root { Node :: Leaf { start , end , data } => { self . root = None ; self . scope = None ; Some ( Entry { start , end , data : Rc :: try_unwrap ( data ) . expect ( " " ) , } ) } Node :: Intermediate { .. } => { let entry = root . unschedule ( when , data ) . map ( | ( entry , scope ) | { self . scope = Some ( scope ) ; Entry { start : entry . start , end : entry . end , data : Rc :: try_unwrap ( entry . data ) . expect ( " " ) , } } ) ; self . root = Some ( root ) ; entry } } , _ => None , } }
Removes the given data from the schedule tree.
Removes the given data from the schedule tree .
&mut self
data
&'a D
&mut self
data
&'a D