feat: bump deps and switch to actix-web-codegen-const-routes

This commit is contained in:
Aravinth Manivannan 2022-08-21 17:57:45 +05:30
parent 46464ac74d
commit 1c1224b405
Signed by untrusted user: realaravinth
GPG key ID: AD9F0F08E855ED88
4 changed files with 42 additions and 57 deletions

79
Cargo.lock generated
View file

@ -2,23 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "actix-codec"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a36c014a3e811624313b51a227b775ecba55d36ef9462bbaac7d4f13e54c9271"
dependencies = [
"bitflags",
"bytes",
"futures-core",
"futures-sink",
"log",
"memchr",
"pin-project-lite",
"tokio",
"tokio-util 0.6.9",
]
[[package]]
name = "actix-codec"
version = "0.5.0"
@ -38,11 +21,11 @@ dependencies = [
[[package]]
name = "actix-http"
version = "3.0.0-rc.3"
version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8b5ba038f3bb4aa29ad9bdd7eba09955ff04503263c497fc61a389d6412f4e8"
checksum = "6f9ffb6db08c1c3a1f4aef540f1a63193adc73c4fbd40b75a95fc8c5258f6e51"
dependencies = [
"actix-codec 0.5.0",
"actix-codec",
"actix-rt",
"actix-service",
"actix-utils",
@ -63,13 +46,13 @@ dependencies = [
"itoa",
"language-tags",
"local-channel",
"log",
"mime",
"percent-encoding",
"pin-project-lite",
"rand",
"sha-1",
"sha1",
"smallvec",
"tracing",
"zstd",
]
@ -85,9 +68,9 @@ dependencies = [
[[package]]
name = "actix-router"
version = "0.5.0-rc.3"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb6506dbef336634ff35d994d58daa0a412ea23751f15f9b4dcac4d594b1ed1f"
checksum = "eb60846b52c118f2f04a56cc90880a274271c489b2498623d58176f8ca21fa80"
dependencies = [
"bytestring",
"firestorm",
@ -149,11 +132,11 @@ dependencies = [
[[package]]
name = "actix-web"
version = "4.0.0-rc.3"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83e3c85bc4116b69913b03f16cff8cade1212508fcd321847d9cfe3d3e41f991"
checksum = "a27e8fe9ba4ae613c21f677c2cfaf0696c3744030c6f485b34634e502d6bb379"
dependencies = [
"actix-codec 0.4.2",
"actix-codec",
"actix-http",
"actix-macros",
"actix-router",
@ -161,9 +144,10 @@ dependencies = [
"actix-server",
"actix-service",
"actix-utils",
"actix-web-codegen 0.5.0-rc.2 (registry+https://github.com/rust-lang/crates.io-index)",
"actix-web-codegen",
"ahash",
"bytes",
"bytestring",
"cfg-if",
"cookie",
"derive_more",
@ -188,9 +172,9 @@ dependencies = [
[[package]]
name = "actix-web-codegen"
version = "0.5.0-rc.2"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d0976042e6ddc82c7d0dedd64d39959bc26d9bba098b2f6c32a73fbef784eaf"
checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56"
dependencies = [
"actix-router",
"proc-macro2",
@ -199,9 +183,9 @@ dependencies = [
]
[[package]]
name = "actix-web-codegen"
version = "0.5.0-rc.2"
source = "git+https://github.com/realaravinth/actix-web#d3881fe107fc8b7301ff36130e0725bd81f4c05c"
name = "actix-web-codegen-const-routes"
version = "0.1.0"
source = "git+https://github.com/realaravinth/actix-web-codegen-const-routes#1cc9b8dbaaef4b3634dabbf537f313200dd91bd9"
dependencies = [
"actix-router",
"proc-macro2",
@ -1101,7 +1085,7 @@ dependencies = [
"actix-http",
"actix-rt",
"actix-web",
"actix-web-codegen 0.5.0-rc.2 (git+https://github.com/realaravinth/actix-web)",
"actix-web-codegen-const-routes",
"bincode",
"chrono",
"config",
@ -1559,9 +1543,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.4"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
@ -1570,9 +1554,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.25"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "remove_dir_all"
@ -1805,10 +1789,10 @@ dependencies = [
]
[[package]]
name = "sha-1"
version = "0.10.0"
name = "sha1"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f"
dependencies = [
"cfg-if",
"cpufeatures",
@ -2058,6 +2042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9"
dependencies = [
"cfg-if",
"log",
"pin-project-lite",
"tracing-core",
]
@ -2352,18 +2337,18 @@ dependencies = [
[[package]]
name = "zstd"
version = "0.10.0+zstd.1.5.2"
version = "0.11.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b1365becbe415f3f0fcd024e2f7b45bacfb5bdd055f0dc113571394114e7bdd"
checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
version = "4.1.4+zstd.1.5.2"
version = "5.0.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f7cd17c9af1a4d6c24beb1cc54b17e2ef7b593dc92f19e9d9acad8b182bbaee"
checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
dependencies = [
"libc",
"zstd-sys",
@ -2371,9 +2356,9 @@ dependencies = [
[[package]]
name = "zstd-sys"
version = "1.6.3+zstd.1.5.2"
version = "2.0.1+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8"
checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
dependencies = [
"cc",
"libc",

View file

@ -11,9 +11,9 @@ repository = "https://github.com/realaravinth/libmedium"
version = "0.1.0"
[dependencies]
actix-http = "3.0.0-beta.8"
actix-http = "3.0.4"
actix-rt = "2"
actix-web = "4.0.0-beta.9"
actix-web = "4.0.1"
bincode = "1.3.3"
chrono = "0.4.19"
config = "0.11"
@ -34,9 +34,9 @@ url = "2.2"
features = ["reqwest"]
version = "0.10.0"
[dependencies.my-codegen]
git = "https://github.com/realaravinth/actix-web"
package = "actix-web-codegen"
[dependencies.actix-web-codegen-const-routes]
git = "https://github.com/realaravinth/actix-web-codegen-const-routes"
package = "actix-web-codegen-const-routes"
[dependencies.reqwest]
features = ["json"]

View file

@ -42,7 +42,7 @@ pub mod routes {
}
/// emmits build details of the bninary
#[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.meta.build_details")]
async fn build_details() -> impl Responder {
let build = BuildDetails {
version: VERSION,

View file

@ -122,14 +122,14 @@ pub struct Post {
const INDEX: &str = include_str!("../templates/index.html");
#[my_codegen::get(path = "crate::V1_API_ROUTES.proxy.index")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.proxy.index")]
async fn index() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(INDEX)
}
#[my_codegen::get(path = "crate::V1_API_ROUTES.proxy.asset")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.proxy.asset")]
async fn assets(path: web::Path<String>, data: AppData) -> impl Responder {
let res = data
.client
@ -149,7 +149,7 @@ async fn assets(path: web::Path<String>, data: AppData) -> impl Responder {
.body(res.bytes().await.unwrap())
}
#[my_codegen::get(path = "crate::V1_API_ROUTES.proxy.by_post_id")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.proxy.by_post_id")]
async fn by_post_id(path: web::Path<String>, data: AppData) -> impl Responder {
let post_data = data.get_post_light(&path).await;
HttpResponse::Found()
@ -162,7 +162,7 @@ async fn by_post_id(path: web::Path<String>, data: AppData) -> impl Responder {
.finish()
}
#[my_codegen::get(path = "crate::V1_API_ROUTES.proxy.page")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.proxy.page")]
async fn page(path: web::Path<(String, String)>, data: AppData) -> impl Responder {
let post_id = path.1.split('-').last();
if post_id.is_none() {