mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-05-02 15:44:45 +00:00
Cleaning up oauth providers conversion.
This commit is contained in:
parent
7585aac446
commit
00c9051e99
1 changed files with 5 additions and 7 deletions
|
@ -55,13 +55,11 @@ impl OAuthProvider {
|
|||
pub fn convert_providers_to_public(
|
||||
oauth_providers: Vec<OAuthProvider>,
|
||||
) -> Vec<PublicOAuthProvider> {
|
||||
let mut result = Vec::<PublicOAuthProvider>::new();
|
||||
for oauth_provider in &oauth_providers {
|
||||
if oauth_provider.enabled {
|
||||
result.push(PublicOAuthProvider(oauth_provider.clone()));
|
||||
}
|
||||
}
|
||||
result
|
||||
oauth_providers
|
||||
.iter()
|
||||
.filter(|x| x.enabled)
|
||||
.map(|x| PublicOAuthProvider(x.clone()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub async fn get_all_public(pool: &mut DbPool<'_>) -> Result<Vec<PublicOAuthProvider>, Error> {
|
||||
|
|
Loading…
Reference in a new issue