pub fn find_expendable_snapshots<'a>(
        &'a self,
        fs: &FS,
        snaps: &'a Vec<FS>,
    ) -> (Vec<&FS>, usize) {
        let name = format!("{}@{}-{}", fs.name, self.prefix, self.label);

        // filter snaps-list fitting to fs.
        let mut snaps: Vec<&FS> = snaps.iter().filter(|&sn| sn.fs == name).collect();

        // Sort descending by FS.name
        snaps.sort_unstable_by(|&a, &b| b.name.cmp(&a.name));

        let size = match snaps.iter().next() {
            None => usize::max_value(),
            Some(&fs) => fs.written,
        };

        (
            // skip amount to hold, return the rest.
            snaps.iter().skip(self.history).map(|t| t.clone()).collect(),
            size,
        )
    }
/// Returns a list of snapshots to destroy.
///
/// # Arguments
///
/// * fs - filesystem to snap over
/// * snaps - List of snapshots, to filter and return.
///
Returns a list of snapshots to destroy.
Returns a list of snapshots to destroy .
pub fn find_expendable_snapshots<'a>(
        &'a self,
        fs: &FS,
        snaps: &'a Vec<FS>,
    ) -> (Vec<&FS>, usize) {
        let name = format!("{}@{}-{}", fs.name, self.prefix, self.label);
        // filter snaps-list fitting to fs.
        let mut snaps: Vec<&FS> = snaps.iter().filter(|&sn| sn.fs == name).collect();
        // Sort descending by FS.name
        snaps.sort_unstable_by(|&a, &b| b.name.cmp(&a.name));
        let size = match snaps.iter().next() {
            None => usize::max_value(),
            Some(&fs) => fs.written,
        };
        (
            // skip amount to hold, return the rest.
            snaps.iter().skip(self.history).map(|t| t.clone()).collect(),
            size,
        )
    }
pub fn find_expendable_snapshots < ' a > ( & ' a self , fs : & FS , snaps : & ' a Vec < FS > , ) -> ( Vec < & FS > , usize ) { let name = format ! ( " " fs name self prefix self label ) ; // filter snaps-list fitting to fs. let mut snaps : Vec < & FS > = snaps . iter ( ) . filter ( | & sn | sn . fs == name ) . collect ( ) ; // Sort descending by FS.name snaps . sort_unstable_by ( | & a , & b | b . name . cmp ( & a . name ) ) ; let size = match snaps . iter ( ) . next ( ) { None => usize :: max_value ( ) , Some ( & fs ) => fs . written , } ; ( // skip amount to hold, return the rest. snaps . iter ( ) . skip ( self . history ) . map ( | t | t . clone ( ) ) . collect ( ) , size , ) }
Returns a list of snapshots to destroy.
Returns a list of snapshots to destroy .
&'a self
fs
&FS
snaps
&'a Vec<FS>
&'a self
fs
&FS
snaps
&'a Vec<FS>