pub fn delete_from_tag(&self, tag_key: &[u8], annotation_id: &str) -> color_eyre::Result<()> {
        let new_indices: Vec<_> =
            utils::split_ids(&self.tag_to_annotations()?.get(tag_key)?.ok_or(
                Apologize::TagNotFound {
                    tag: std::str::from_utf8(tag_key)?.to_owned(),
                },
            )?)?
            .into_iter()
            .filter(|index_i| index_i != annotation_id)
            .collect();
        if new_indices.is_empty() {
            self.tag_to_annotations()?.remove(tag_key)?;
        } else {
            self.tag_to_annotations()?
                .insert(tag_key.to_vec(), utils::join_ids(&new_indices)?)?;
        }
        Ok(())
    }
/// Delete an annotation index from the tag tree
Delete an annotation index from the tag tree
Delete an annotation index from the tag tree
pub fn delete_from_tag(&self, tag_key: &[u8], annotation_id: &str) -> color_eyre::Result<()> {
        let new_indices: Vec<_> =
            utils::split_ids(&self.tag_to_annotations()?.get(tag_key)?.ok_or(
                Apologize::TagNotFound {
                    tag: std::str::from_utf8(tag_key)?.to_owned(),
                },
            )?)?
            .into_iter()
            .filter(|index_i| index_i != annotation_id)
            .collect();
        if new_indices.is_empty() {
            self.tag_to_annotations()?.remove(tag_key)?;
        } else {
            self.tag_to_annotations()?
                .insert(tag_key.to_vec(), utils::join_ids(&new_indices)?)?;
        }
        Ok(())
    }
pub fn delete_from_tag ( & self , tag_key : & [ u8 ] , annotation_id : & str ) -> color_eyre :: Result < ( ) > { let new_indices : Vec < _ > = utils :: split_ids ( & self . tag_to_annotations ( ) ? . get ( tag_key ) ? . ok_or ( Apologize :: TagNotFound { tag : std :: str :: from_utf8 ( tag_key ) ? . to_owned ( ) , } , ) ? ) ? . into_iter ( ) . filter ( | index_i | index_i != annotation_id ) . collect ( ) ; if new_indices . is_empty ( ) { self . tag_to_annotations ( ) ? . remove ( tag_key ) ? ; } else { self . tag_to_annotations ( ) ? . insert ( tag_key . to_vec ( ) , utils :: join_ids ( & new_indices ) ? ) ? ; } Ok ( ( ) ) }
Delete an annotation index from the tag tree
Delete an annotation index from the tag tree
&self
tag_key
&[u8]
annotation_id
&str
&self
tag_key
&[u8]
annotation_id
&str