~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


12771515 Mark Drobnak

5 years ago
Merge pull request #123 from cuviper/actix-web-3
Files changed (2) hide show
  1. Cargo.toml +2 -3
  2. examples/actix.rs +2 -2
Cargo.toml CHANGED
@@ -37,8 +37,7 @@ rust-embed-impl = { version = "5.5.1", path = "impl"}
37
37
  rust-embed-utils = { version = "5.0.0", path = "utils"}
38
38
 
39
39
  include-flate = { version = "0.1", optional = true, features = ["stable"] }
40
- actix-web = { version = "2", default-features = false, optional = true }
40
+ actix-web = { version = "3", default-features = false, optional = true }
41
- actix-rt = { version = "1", optional = true }
42
41
  mime_guess = { version = "2", optional = true }
43
42
  tokio = { version = "0.2", optional = true, features = ["macros"] }
44
43
  warp = { version = "0.2", default-features = false, optional = true }
@@ -49,7 +48,7 @@ debug-embed = ["rust-embed-impl/debug-embed", "rust-embed-utils/debug-embed"]
49
48
  interpolate-folder-path = ["rust-embed-impl/interpolate-folder-path"]
50
49
  compression = ["rust-embed-impl/compression", "include-flate"]
51
50
  nightly = ["rocket"]
52
- actix = ["actix-web", "actix-rt", "mime_guess"]
51
+ actix = ["actix-web", "mime_guess"]
53
52
  warp-ex = ["warp", "tokio", "mime_guess"]
54
53
 
55
54
  [badges]
examples/actix.rs CHANGED
@@ -26,11 +26,11 @@ fn index() -> HttpResponse {
26
26
  handle_embedded_file("index.html")
27
27
  }
28
28
 
29
- fn dist(path: web::Path<(String,)>) -> HttpResponse {
29
+ fn dist(path: web::Path<String>) -> HttpResponse {
30
30
  handle_embedded_file(&path.0)
31
31
  }
32
32
 
33
- #[actix_rt::main]
33
+ #[actix_web::main]
34
34
  async fn main() -> std::io::Result<()> {
35
35
  HttpServer::new(|| {
36
36
  App::new()