1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
use sp_std::prelude::*;

use crate::{Module, Trait};

impl<T: Trait> Module<T> {
    pub fn filter_followed_accounts(account: T::AccountId, maybe_following: Vec<T::AccountId>) -> Vec<T::AccountId> {
        maybe_following.iter()
            .filter(|maybe_following| Self::account_followed_by_account((&account, maybe_following)))
            .cloned().collect()
    }
}