mirror of
https://codeberg.org/demostf/api-test.git
synced 2026-06-03 17:44:07 +02:00
clippy fixes
This commit is contained in:
parent
67465fc22a
commit
c4aa610433
2 changed files with 8 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use demostf_client::ApiClient;
|
||||
use sqlx::{Pool, Postgres};
|
||||
use color_eyre::Result;
|
||||
use demostf_client::ApiClient;
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
use sqlx::{Pool, Postgres};
|
||||
|
||||
pub struct Harness {
|
||||
client: ApiClient,
|
||||
|
|
@ -13,14 +13,11 @@ impl Harness {
|
|||
let client = ApiClient::with_base_url(base_url)?;
|
||||
let db = PgPoolOptions::new()
|
||||
.max_connections(5)
|
||||
.connect(&db_url)
|
||||
.connect(db_url)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Ok(Harness {
|
||||
client,
|
||||
db,
|
||||
})
|
||||
Ok(Harness { client, db })
|
||||
}
|
||||
|
||||
pub async fn reset(&self) -> Result<()> {
|
||||
|
|
@ -56,4 +53,4 @@ impl Harness {
|
|||
pub fn client(&self) -> ApiClient {
|
||||
self.client.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ async fn main() -> Result<()> {
|
|||
assert_eq(list.len(), 1)?;
|
||||
assert_eq(list[0].id, 4)?;
|
||||
|
||||
let players = list[0].get_players(&client).await?;
|
||||
let players = list[0].get_players(client).await?;
|
||||
let reconnected_player = players
|
||||
.iter()
|
||||
.find(|player| player.user.steam_id == SteamID::from(76561197998883586))
|
||||
|
|
@ -364,7 +364,7 @@ async fn main() -> Result<()> {
|
|||
|
||||
test.step("list time filter after", |client| async move {
|
||||
let list = client
|
||||
.list(ListParams::default().with_after(first_time.clone()), 1)
|
||||
.list(ListParams::default().with_after(first_time), 1)
|
||||
.await?;
|
||||
|
||||
assert_eq(list.len(), 2)?;
|
||||
|
|
@ -376,7 +376,7 @@ async fn main() -> Result<()> {
|
|||
|
||||
test.step("list time filter before", |client| async move {
|
||||
let list = client
|
||||
.list(ListParams::default().with_before(first_time.clone()), 1)
|
||||
.list(ListParams::default().with_before(first_time), 1)
|
||||
.await?;
|
||||
|
||||
assert_eq(list.len(), 2)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue