pub fn encode(&self) -> String {
        let tags = self
            .tags
            .iter()
            .map(|(k, v)| format!("{}:{}", k, v))
            .collect::<Vec<String>>()
            .join("\t");

        match (self.file_path.to_str(), self.tags.len(), &self.kind) {
            (None, _, _) => String::new(),
            (Some(fp), 0, TokenKind::Undefined) => {
                format!("{}\t{}\t{}", self.name, fp, self.address)
            }
            (Some(fp), _, TokenKind::Undefined) => {
                format!("{}\t{}\t{};\"\t{}", self.name, fp, self.address, tags)
            }
            (Some(fp), 0, kind) => format!(
                "{}\t{}\t{};\"\t{}",
                self.name,
                fp,
                self.address,
                kind.to_token_char(self.language)
            ),
            (Some(fp), _, kind) => format!(
                "{}\t{}\t{};\"\t{}\t{}",
                self.name,
                fp,
                self.address,
                kind.to_token_char(self.language),
                tags
            ),
        }
    }
/// encode a `CtagItem` into its line representation within a tags file
encode a `CtagItem` into its line representation within a tags file
encode a ` CtagItem ` into its line representation within a tags file
pub fn encode(&self) -> String {
        let tags = self
            .tags
            .iter()
            .map(|(k, v)| format!("{}:{}", k, v))
            .collect::<Vec<String>>()
            .join("\t");
        match (self.file_path.to_str(), self.tags.len(), &self.kind) {
            (None, _, _) => String::new(),
            (Some(fp), 0, TokenKind::Undefined) => {
                format!("{}\t{}\t{}", self.name, fp, self.address)
            }
            (Some(fp), _, TokenKind::Undefined) => {
                format!("{}\t{}\t{};\"\t{}", self.name, fp, self.address, tags)
            }
            (Some(fp), 0, kind) => format!(
                "{}\t{}\t{};\"\t{}",
                self.name,
                fp,
                self.address,
                kind.to_token_char(self.language)
            ),
            (Some(fp), _, kind) => format!(
                "{}\t{}\t{};\"\t{}\t{}",
                self.name,
                fp,
                self.address,
                kind.to_token_char(self.language),
                tags
            ),
        }
    }
pub fn encode ( & self ) -> String { let tags = self . tags . iter ( ) . map ( | ( k , v ) | format ! ( " " k v ) ) . collect :: < Vec < String > > ( ) . join ( " \t " ) ; match ( self . file_path . to_str ( ) , self . tags . len ( ) , & self . kind ) { ( None , _ , _ ) => String :: new ( ) , ( Some ( fp ) , 0 , TokenKind :: Undefined ) => { format ! ( " \t \t " self name fp self address ) } ( Some ( fp ) , _ , TokenKind :: Undefined ) => { format ! ( " \t \t \" \t " self name fp self address tags ) } ( Some ( fp ) , 0 , kind ) => format ! ( " \t \t \" \t " self name fp self address kind to_token_char ( self language ) ) , ( Some ( fp ) , _ , kind ) => format ! ( " \t \t \" \t \t " self name fp self address kind to_token_char ( self language ) tags ) , } }
encode a `CtagItem` into its line representation within a tags file
encode a ` CtagItem ` into its line representation within a tags file
&self
&self