fn delete_old_mergeable_notes(&mut self,
                                  local_note: &LocalNote,
                                  uid_to_keep: u32) -> Result<()>
    {
        self.session.session.
            select(&local_note.metadata.folder()).map_err(|e| e.into())
            .and_then(|_| self.session.session.uid_search(
                format!("HEADER X-Universally-Unique-Identifier {}", local_note.metadata.uuid)))
            .map_err(|e| e.into())
            .and_then(|uids| {
                let uids: Vec<String> = uids.into_iter()
                    .filter(|uid| uid != &uid_to_keep )
                    .map(|x| (x.to_string())).collect();
                for uid in uids {
                    info!("Will delete remote note with uid: {}", uid);
                    self.flag_as_deleted(uid)?;
                }
                self.delete_flagged()?;
                Ok(())
            })
    }
/// Deletes all notes remotely that have the uuid provided by local_note, expect
/// the note with uid_to_keep
Deletes all notes remotely that have the uuid provided by local_note, expect
the note with uid_to_keep
Deletes all notes remotely that have the uuid provided by local_note expect the note with uid_to_keep
fn delete_old_mergeable_notes(&mut self,
                                  local_note: &LocalNote,
                                  uid_to_keep: u32) -> Result<()>
    {
        self.session.session.
            select(&local_note.metadata.folder()).map_err(|e| e.into())
            .and_then(|_| self.session.session.uid_search(
                format!("HEADER X-Universally-Unique-Identifier {}", local_note.metadata.uuid)))
            .map_err(|e| e.into())
            .and_then(|uids| {
                let uids: Vec<String> = uids.into_iter()
                    .filter(|uid| uid != &uid_to_keep )
                    .map(|x| (x.to_string())).collect();
                for uid in uids {
                    info!("Will delete remote note with uid: {}", uid);
                    self.flag_as_deleted(uid)?;
                }
                self.delete_flagged()?;
                Ok(())
            })
    }
fn delete_old_mergeable_notes ( & mut self , local_note : & LocalNote , uid_to_keep : u32 ) -> Result < ( ) > { self . session . session . select ( & local_note . metadata . folder ( ) ) . map_err ( | e | e . into ( ) ) . and_then ( | _ | self . session . session . uid_search ( format ! ( " " local_note metadata uuid ) ) ) . map_err ( | e | e . into ( ) ) . and_then ( | uids | { let uids : Vec < String > = uids . into_iter ( ) . filter ( | uid | uid != & uid_to_keep ) . map ( | x | ( x . to_string ( ) ) ) . collect ( ) ; for uid in uids { info ! ( " " uid ) ; self . flag_as_deleted ( uid ) ? ; } self . delete_flagged ( ) ? ; Ok ( ( ) ) } ) }
Deletes all notes remotely that have the uuid provided by local_note, expect
the note with uid_to_keep
Deletes all notes remotely that have the uuid provided by local_note expect the note with uid_to_keep
&mut self
local_note
&LocalNote
uid_to_keep
u32
&mut self
local_note
&LocalNote
uid_to_keep
u32