Upgrade all crates

main
Charlotte Som 2023-11-16 01:46:52 +00:00
parent 45efb19da7
commit 882acbf147
3 changed files with 767 additions and 552 deletions

1305
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@ edition = "2021"
[dependencies] [dependencies]
dotenv = "0.15.0" dotenv = "0.15.0"
rand = "0.8.5" rand = "0.8.5"
serde = { version = "1.0.164", features = ["derive"] } serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.99" serde_json = "1.0.108"
sqlx = { version = "0.6.3", features = ["sqlite", "runtime-tokio-rustls"] } sqlx = { version = "0.7.2", features = ["sqlite", "runtime-tokio-rustls"] }
tokio = { version = "1.29.1", features = ["full"] } tokio = { version = "1.34.0", features = ["full"] }
warp = "0.3.5" warp = "0.3.6"

View File

@ -159,7 +159,7 @@ async fn list_redirects(db: SqlitePool, authorization: String) -> Result<impl Re
async fn get_redirects(db: SqlitePool) -> sqlx::Result<Vec<Redirect>> { async fn get_redirects(db: SqlitePool) -> sqlx::Result<Vec<Redirect>> {
let mut conn = db.acquire().await?; let mut conn = db.acquire().await?;
let query = sqlx::query_as!(Redirect, "SELECT * FROM redirects"); let query = sqlx::query_as!(Redirect, "SELECT * FROM redirects");
query.fetch_all(&mut conn).await query.fetch_all(&mut *conn).await
} }
match get_redirects(db).await { match get_redirects(db).await {
@ -172,7 +172,7 @@ async fn lookup_redirect(path: String, db: SqlitePool) -> Result<impl Reply, Rej
async fn find_redirect(db: SqlitePool, path: &str) -> sqlx::Result<Redirect> { async fn find_redirect(db: SqlitePool, path: &str) -> sqlx::Result<Redirect> {
let mut conn = db.acquire().await?; let mut conn = db.acquire().await?;
let query = sqlx::query_as!(Redirect, "SELECT * FROM redirects WHERE path = ?", path); let query = sqlx::query_as!(Redirect, "SELECT * FROM redirects WHERE path = ?", path);
query.fetch_one(&mut conn).await query.fetch_one(&mut *conn).await
} }
match find_redirect(db, &path).await { match find_redirect(db, &path).await {