From 1a2abe96f2b6ad12a8f2b6838fff04d1d7b24336 Mon Sep 17 00:00:00 2001 From: aumetra Date: Sat, 28 Oct 2023 17:29:01 +0200 Subject: [PATCH] Fix nightly clippy lint --- kitsune/src/http/handler/users/outbox.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kitsune/src/http/handler/users/outbox.rs b/kitsune/src/http/handler/users/outbox.rs index a4bac98ab..a14415d14 100644 --- a/kitsune/src/http/handler/users/outbox.rs +++ b/kitsune/src/http/handler/users/outbox.rs @@ -2,7 +2,6 @@ use crate::{error::Result, http::responder::ActivityPubJson, state::Zustand}; use axum::extract::{OriginalUri, Path, Query, State}; use axum_extra::either::Either; use diesel::{BelongingToDsl, ExpressionMethods, QueryDsl, SelectableHelper}; -use diesel_async::RunQueryDsl; use futures_util::{stream, StreamExt, TryStreamExt}; use kitsune_core::{ mapping::IntoActivity, @@ -42,6 +41,8 @@ pub async fn get( let account = state .db_pool() .with_connection(|db_conn| { + use diesel_async::RunQueryDsl; + accounts::table .find(account_id) .filter(accounts::local.eq(true)) @@ -72,7 +73,7 @@ pub async fn get( let id = format!("{}{original_uri}", url_service.base_url()); let prev = format!( "{base_url}?page=true&min_id={}", - posts.get(0).map_or(Uuid::max(), |post| post.id) + posts.first().map_or(Uuid::max(), |post| post.id) ); let next = format!( "{base_url}?page=true&max_id={}", @@ -96,6 +97,8 @@ pub async fn get( let public_post_count = state .db_pool() .with_connection(|db_conn| { + use diesel_async::RunQueryDsl; + Post::belonging_to(&account) .add_post_permission_check(PermissionCheck::default()) .count()