INNER CODE UNIT · Rust

new_postgres_with_credit_bypass_voters

zly2006/zhihu-plus-plus · aigc-vote-server/src/lib.rs:57

    pub async fn new_postgres_with_credit_bypass_voters(
        database_url: &str,
        credit_bypass_voters: HashSet<String>,
    ) -> Result<Self, ServiceError> {
        Ok(Self {
            store: Arc::new(PostgresVoteStore::connect(database_url, credit_bypass_voters).await?),
        })
    }
}

pub fn parse_credit_bypass_voters(value: &str) -> HashSet<String> {
    value
        .split(',')
        .filter_map(|item| normalize_identity_token(item))
        .collect()
}

#[derive(Debug, Deserialize, Serialize)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…