/// Creates an Alfred item from version data.
Creates an Alfred item from version data.
Creates an Alfred item from version data .
pub fn to_alfred_item(&self) -> Item<'static> {
        let mut builder = ItemBuilder::new(format!("v{} ({})", &self.number, &self.channel));
        if let Some(release_date) = self.release_date() {
            // August 16 2019
            let rel_date_str = release_date
                .format(format_description!("[month repr:long] [day], [year]"))
                .unwrap();
            builder.set_subtitle(format!("Released {}", rel_date_str));
        }
        if let Some(blog_post) = self.blog_post_path.as_deref() {
            let blog_post_url = format!("{}{}", RUST_BLOG_ROOT, blog_post.to_owned());
            builder.set_quicklook_url(blog_post_url.clone());
            builder.set_modifier(
                Modifier::Option,
                Some("Press enter to view release post."),
                Some(blog_post_url),
                true,
                None,
            );
        };
        builder.into_item()
    }
pub fn to_alfred_item ( & self ) -> Item < ' static > { let mut builder = ItemBuilder :: new ( format ! ( " " self number self channel ) ) ; if let Some ( release_date ) = self . release_date ( ) { // August 16 2019 let rel_date_str = release_date . format ( format_description ! ( " " ) ) . unwrap ( ) ; builder . set_subtitle ( format ! ( " " rel_date_str ) ) ; } if let Some ( blog_post ) = self . blog_post_path . as_deref ( ) { let blog_post_url = format ! ( " " RUST_BLOG_ROOT blog_post to_owned ( ) ) ; builder . set_quicklook_url ( blog_post_url . clone ( ) ) ; builder . set_modifier ( Modifier :: Option , Some ( " " ) , Some ( blog_post_url ) , true , None , ) ; } ; builder . into_item ( ) }
Creates an Alfred item from version data.
Creates an Alfred item from version data .
&self