Skip to content

Commit b41ba20

Browse files
committed
controllers/krate/search: Replace OnceCell with OnceLock
This allows the `FilterParams` struct to be `Send` which helps with migrating this endpoint to async/await.
1 parent 4a747ef commit b41ba20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/controllers/krate/search.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use diesel_async::async_connection_wrapper::AsyncConnectionWrapper;
1010
use diesel_async::AsyncPgConnection;
1111
use diesel_full_text_search::*;
1212
use http::request::Parts;
13-
use std::cell::OnceCell;
1413
use tokio::runtime::Handle;
14+
use std::sync::OnceLock;
1515

1616
use crate::app::AppState;
1717
use crate::controllers::helpers::Paginate;
@@ -282,8 +282,8 @@ struct FilterParams<'a> {
282282
team_id: Option<i32>,
283283
following: bool,
284284
has_ids: bool,
285-
_auth_user_id: OnceCell<i32>,
286-
_ids: OnceCell<Option<Vec<String>>>,
285+
_auth_user_id: OnceLock<i32>,
286+
_ids: OnceLock<Option<Vec<String>>>,
287287
}
288288

289289
impl<'a> FilterParams<'a> {

0 commit comments

Comments
 (0)