pub fn filter_posts(&self, posts: &mut Vec<PostEntry>) -> u16 {
        let mut filtered: u16 = 0;
        let mut flag_worker = FlagWorker::default();
        for blacklist_line in &self.blacklist_tokens.lines {
            posts.retain(|e| {
                flag_worker.reset_worker();
                flag_worker.set_flag_margin(&blacklist_line.tags);
                flag_worker.check_post(e, &blacklist_line);
                if flag_worker.is_flagged() {
                    filtered += 1;
                }

                // This inverses the flag to make sure it retains what isn't flagged and disposes of
                // what is flagged.
                !flag_worker.is_flagged()
            });
        }

        if filtered > 0 {
            trace!("Filtered {} posts with blacklist...", filtered);
        } else {
            trace!("No posts filtered...");
        }

        filtered
    }
/// Filters through a set of posts, only retaining posts that aren't blacklisted.
///
/// # Arguments
///
/// * `posts`: Posts to filter through.
///
/// returns: u16 of posts that were positively filtered
Filters through a set of posts, only retaining posts that aren't blacklisted.
Filters through a set of posts only retaining posts that aren ' t blacklisted .
pub fn filter_posts(&self, posts: &mut Vec<PostEntry>) -> u16 {
        let mut filtered: u16 = 0;
        let mut flag_worker = FlagWorker::default();
        for blacklist_line in &self.blacklist_tokens.lines {
            posts.retain(|e| {
                flag_worker.reset_worker();
                flag_worker.set_flag_margin(&blacklist_line.tags);
                flag_worker.check_post(e, &blacklist_line);
                if flag_worker.is_flagged() {
                    filtered += 1;
                }
                // This inverses the flag to make sure it retains what isn't flagged and disposes of
                // what is flagged.
                !flag_worker.is_flagged()
            });
        }
        if filtered > 0 {
            trace!("Filtered {} posts with blacklist...", filtered);
        } else {
            trace!("No posts filtered...");
        }
        filtered
    }
pub fn filter_posts ( & self , posts : & mut Vec < PostEntry > ) -> u16 { let mut filtered : u16 = 0 ; let mut flag_worker = FlagWorker :: default ( ) ; for blacklist_line in & self . blacklist_tokens . lines { posts . retain ( | e | { flag_worker . reset_worker ( ) ; flag_worker . set_flag_margin ( & blacklist_line . tags ) ; flag_worker . check_post ( e , & blacklist_line ) ; if flag_worker . is_flagged ( ) { filtered += 1 ; } // This inverses the flag to make sure it retains what isn't flagged and disposes of // what is flagged. ! flag_worker . is_flagged ( ) } ) ; } if filtered > 0 { trace ! ( " " filtered ) ; } else { trace ! ( " " ) ; } filtered }
Filters through a set of posts, only retaining posts that aren't blacklisted.
Filters through a set of posts only retaining posts that aren ' t blacklisted .
&self
posts
&mut Vec<PostEntry>
&self
posts
&mut Vec<PostEntry>