Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies #1452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,060 changes: 1,125 additions & 935 deletions atcoder-problems-backend/Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions atcoder-problems-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ publish = false
[dependencies]
# Logging
log = "0.4"
fern = "0.6.1"
fern = "0.6.2"

rand = "0.8.5"
chrono = "0.4"
rust-s3 = { version = "0.32.3", features = ["no-verify-ssl"] }
rust-s3 = { version = "0.33", features = ["no-verify-ssl"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

Expand All @@ -23,17 +23,17 @@ sql-client = { path = "./sql-client" }
atcoder-client = { path = "./atcoder-client" }

# Web framework
actix-web = "4.2.1"
actix-web = "4.4.0"
actix-service = "2.0.2"
reqwest = { version = "0.11", features = ["json"] }

async-trait = "0.1"

anyhow = "1.0"
futures-util = "0.3.25"
futures-util = "0.3.29"

[dev-dependencies]
httpmock = "0.6.6"
httpmock = "0.6.8"

[workspace]
members = ["sql-client", "atcoder-client"]
2 changes: 1 addition & 1 deletion atcoder-problems-backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.63.0 AS development
FROM rust:1.69.0 AS development
RUN rustup component add rustfmt
RUN rustup component add clippy

Expand Down
4 changes: 2 additions & 2 deletions atcoder-problems-backend/atcoder-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ publish = false

[dependencies]
reqwest = { version = "0.11", features = ["json", "gzip", "cookies"] }
scraper = { version = "0.16", default-features = false }
scraper = { version = "0.18", default-features = false }
chrono = "0.4"
regex = "1"
regex = "1.10"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
Expand Down
12 changes: 6 additions & 6 deletions atcoder-problems-backend/sql-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sqlx = { version = "0.6.2", features = ["postgres", "runtime-tokio-rustls"] }
async-trait = "0.1"
sqlx = { version = "0.7.2", features = ["postgres", "runtime-tokio-rustls"] }
async-trait = "0.1.74"
serde = { version = "1.0", features = ["derive"] }
uuid = { version = "1.1", features = ["serde", "v4"] }
uuid = { version = "1.5", features = ["serde", "v4"] }
anyhow = "1.0"
tokio = { version = "1.23", features = ["macros"] }
regex = "1"
chrono = "0.4"
tokio = { version = "1.33", features = ["macros"] }
regex = "1.10"
chrono = "0.4.31"
5 changes: 3 additions & 2 deletions atcoder-problems-backend/sql-client/src/accepted_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::models::{Submission, UserProblemCount};
use crate::{PgPool, MAX_INSERT_ROWS};
use anyhow::Result;
use async_trait::async_trait;
use sqlx::postgres::PgRow;
use sqlx::Row;
use std::collections::{BTreeMap, BTreeSet};
use std::ops::Range;
Expand Down Expand Up @@ -60,7 +61,7 @@ impl AcceptedCountClient for PgPool {
",
)
.bind(user_id)
.try_map(|row| row.try_get::<i32, _>("problem_count"))
.try_map(|row: PgRow| row.try_get::<i32, _>("problem_count"))
.fetch_one(self)
.await
.ok()?;
Expand All @@ -76,7 +77,7 @@ impl AcceptedCountClient for PgPool {
",
)
.bind(accepted_count)
.try_map(|row| row.try_get::<i64, _>("rank"))
.try_map(|row: PgRow| row.try_get::<i64, _>("rank"))
.fetch_one(self)
.await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::PgPool;
use anyhow::{ensure, Context, Result};
use async_trait::async_trait;
use serde::Serialize;
use sqlx::postgres::PgRow;
use sqlx::Row;
use std::collections::BTreeMap;

Expand Down Expand Up @@ -53,7 +54,7 @@ impl ProblemListManager for PgPool {
",
)
.bind(internal_user_id)
.try_map(|row| {
.try_map(|row: PgRow| {
let internal_list_id: String = row.try_get("internal_list_id")?;
let internal_list_name: String = row.try_get("internal_list_name")?;
let internal_user_id: String = row.try_get("internal_user_id")?;
Expand Down Expand Up @@ -108,7 +109,7 @@ impl ProblemListManager for PgPool {
",
)
.bind(internal_list_id)
.map(|row| {
.map(|row: PgRow| {
let internal_list_id: String = row.get(0);
let internal_list_name: String = row.get(1);
let internal_user_id: String = row.get(2);
Expand Down Expand Up @@ -198,7 +199,7 @@ impl ProblemListManager for PgPool {
"SELECT problem_id FROM internal_problem_list_items WHERE internal_list_id = $1",
)
.bind(internal_list_id)
.try_map(|row| row.try_get::<String, _>("problem_id"))
.try_map(|row: PgRow| row.try_get::<String, _>("problem_id"))
.fetch_all(self)
.await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::PgPool;
use anyhow::{ensure, Context, Result};
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use sqlx::postgres::PgRow;
use sqlx::Row;
use uuid::Uuid;

Expand Down Expand Up @@ -248,7 +249,7 @@ impl VirtualContestManager for PgPool {
",
)
.bind(contest_id)
.try_map(|row| row.try_get::<Option<String>, _>("atcoder_user_id"))
.try_map(|row: PgRow| row.try_get::<Option<String>, _>("atcoder_user_id"))
.fetch_all(self)
.await?
.into_iter()
Expand Down Expand Up @@ -315,7 +316,7 @@ impl VirtualContestManager for PgPool {
",
)
.bind(time)
.try_map(|row| {
.try_map(|row: PgRow| {
let problem_id: String = row.try_get("problem_id")?;
let end_second: i64 = row.try_get("end_second")?;
Ok((problem_id, end_second))
Expand Down Expand Up @@ -348,7 +349,7 @@ impl VirtualContestManager for PgPool {
)
.bind(user_id)
.bind(contest_id)
.try_map(|row| row.try_get::<String, _>("id"))
.try_map(|row: PgRow| row.try_get::<String, _>("id"))
.fetch_one(self)
.await
.context("The target contest does not exist.")?;
Expand All @@ -373,7 +374,7 @@ impl VirtualContestManager for PgPool {
",
)
.bind(contest_id)
.execute(&mut tx)
.execute(&mut *tx)
.await?;

// The following is a trick for bulk-inserting.
Expand All @@ -394,7 +395,7 @@ impl VirtualContestManager for PgPool {
.bind(problem_ids)
.bind(points)
.bind(orders)
.execute(&mut tx)
.execute(&mut *tx)
.await?;

tx.commit().await?;
Expand Down
7 changes: 4 additions & 3 deletions atcoder-problems-backend/sql-client/src/rated_point_sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::models::{ContestProblem, Submission, UserSum};
use crate::{PgPool, FIRST_AGC_EPOCH_SECOND, MAX_INSERT_ROWS, UNRATED_STATE};
use anyhow::Result;
use async_trait::async_trait;
use sqlx::postgres::PgRow;
use sqlx::Row;
use std::collections::{BTreeMap, BTreeSet};
use std::ops::Range;
Expand Down Expand Up @@ -35,7 +36,7 @@ impl RatedPointSumClient for PgPool {
)
.bind(FIRST_AGC_EPOCH_SECOND)
.bind(UNRATED_STATE)
.try_map(|row| row.try_get::<String, _>("id"))
.try_map(|row: PgRow| row.try_get::<String, _>("id"))
.fetch_all(self);

let rated_problem_ids_fut = sqlx::query_as::<_, ContestProblem>(
Expand Down Expand Up @@ -110,7 +111,7 @@ impl RatedPointSumClient for PgPool {
",
)
.bind(user_id)
.try_map(|row| row.try_get::<i64, _>("point_sum"))
.try_map(|row: PgRow| row.try_get::<i64, _>("point_sum"))
.fetch_one(self)
.await
.ok()?;
Expand All @@ -120,7 +121,7 @@ impl RatedPointSumClient for PgPool {
async fn get_rated_point_sum_rank(&self, rated_point_sum: i64) -> Result<i64> {
let rank = sqlx::query("SELECT COUNT(*) AS rank FROM rated_point_sum WHERE point_sum > $1")
.bind(rated_point_sum)
.try_map(|row| row.try_get::<i64, _>("rank"))
.try_map(|row: PgRow| row.try_get::<i64, _>("rank"))
.fetch_one(self)
.await?;
Ok(rank)
Expand Down
9 changes: 4 additions & 5 deletions atcoder-problems-backend/sql-client/src/streak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ use crate::models::{Submission, UserStreak};
use crate::{PgPool, MAX_INSERT_ROWS};
use anyhow::Result;
use async_trait::async_trait;

use sqlx::Row;

use chrono::Duration;
use chrono::{DateTime, Datelike, FixedOffset, TimeZone, Utc};
use sqlx::postgres::PgRow;
use sqlx::Row;
use std::cmp;
use std::collections::BTreeMap;
use std::ops::Range;
Expand Down Expand Up @@ -49,7 +48,7 @@ impl StreakClient for PgPool {
",
)
.bind(user_id)
.try_map(|row| row.try_get::<i64, _>("streak"))
.try_map(|row: PgRow| row.try_get::<i64, _>("streak"))
.fetch_one(self)
.await
.ok()?;
Expand All @@ -66,7 +65,7 @@ impl StreakClient for PgPool {
",
)
.bind(streak_count)
.try_map(|row| row.try_get::<i64, _>("rank"))
.try_map(|row: PgRow| row.try_get::<i64, _>("rank"))
.fetch_one(self)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion atcoder-problems-backend/sql-client/src/submission_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::models::Submission;
use crate::PgPool;
use anyhow::Result;
use async_trait::async_trait;
use sqlx::postgres::PgRow;
use sqlx::Row;
use std::ops::Range;

Expand Down Expand Up @@ -306,7 +307,7 @@ impl SubmissionClient for PgPool {
.bind(user_id)
.bind(range.start)
.bind(range.end)
.try_map(|row| row.try_get::<i64, _>("c"))
.try_map(|row: PgRow| row.try_get::<i64, _>("c"))
.fetch_one(self)
.await?;
Ok(count as usize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use sql_client::models::Submission;
use sql_client::problems_submissions::ProblemsSubmissionUpdater;
use sql_client::submission_client::SubmissionClient;
use sql_client::PgPool;
use sqlx::postgres::PgRow;
use sqlx::Row;

mod utils;
Expand All @@ -25,7 +26,7 @@ async fn get_from(pool: &PgPool, table: Table) -> Vec<(String, String, i64)> {

sqlx::query(&query)
.bind(table)
.map(|row| {
.map(|row: PgRow| {
let contest_id: String = row.get("contest_id");
let problem_id: String = row.get("problem_id");
let submission_id: i64 = row.get("submission_id");
Expand Down