pub fn reset(&mut self) -> bool {
        if self.dirty() {
            self.0.drain(..self.0.len() - 1);
            true
        } else {
            false
        }
    }
/// Remove all elements except the last one, making the oldest entry the "current value".
///
/// The returned bool indicates if any entries were removed.
///
/// # Example
/// ```
///# use yewtil::History;
/// let mut history = History::new(0);
/// history.set(1);
/// history.set(2);
///
/// history.reset();
/// assert_eq!(*history, 0);
/// assert_eq!(history.count(), 1);
/// ```
Remove all elements except the last one, making the oldest entry the "current value".
The returned bool indicates if any entries were removed.

Example
```
Remove all elements except the last one making the oldest entry the " current value " . The returned bool indicates if any entries were removed . Example ` ` `
pub fn reset(&mut self) -> bool {
        if self.dirty() {
            self.0.drain(..self.0.len() - 1);
            true
        } else {
            false
        }
    }
pub fn reset ( & mut self ) -> bool { if self . dirty ( ) { self . 0 . drain ( .. self . 0 . len ( ) - 1 ) ; true } else { false } }
Remove all elements except the last one, making the oldest entry the "current value".
Remove all elements except the last one making the oldest entry the " current value " .
&mut self
&mut self
use yewtil::history;
let mut history = History::new(0);
history.set(1);
history.set(2).


let mut history = History :: new ( 0 ) ; history . set ( 1 ) ; history . set ( 2 ) .