Switching to iterator.
This commit is contained in:
parent
63cf0a8eb6
commit
4f6a53b7cf
1 changed files with 5 additions and 4 deletions
|
@ -107,11 +107,12 @@ pub(in crate::api) async fn linked_instances(pool: &DbPool) -> Result<Vec<String
|
||||||
})
|
})
|
||||||
.await??;
|
.await??;
|
||||||
|
|
||||||
for actor_id in &distinct_communities {
|
instances = distinct_communities
|
||||||
instances.push(Url::parse(actor_id)?.host_str().unwrap_or("").to_string());
|
.iter()
|
||||||
}
|
.map(|actor_id| Ok(Url::parse(actor_id)?.host_str().unwrap_or("").to_string()))
|
||||||
|
.collect::<Result<Vec<String>, LemmyError>>()?;
|
||||||
|
|
||||||
instances.extend(Settings::get().get_allowed_instances().into_iter());
|
instances.append(&mut Settings::get().get_allowed_instances());
|
||||||
instances.retain(|a| {
|
instances.retain(|a| {
|
||||||
!Settings::get().get_blocked_instances().contains(a)
|
!Settings::get().get_blocked_instances().contains(a)
|
||||||
&& !a.eq("")
|
&& !a.eq("")
|
||||||
|
|
Loading…
Reference in a new issue