~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.


28a0b8b6 lazywalker

4 years ago
use tokio-1 with axum demo use rename-dependency to keep multi version of tokio
Files changed (2) hide show
  1. Cargo.toml +3 -2
  2. examples/axum.rs +1 -0
Cargo.toml CHANGED
@@ -49,10 +49,11 @@ rust-embed-utils = { version = "7.0.0", path = "utils"}
49
49
  include-flate = { version = "0.1", optional = true, features = ["stable"] }
50
50
  actix-web = { version = "3", default-features = false, optional = true }
51
51
  mime_guess = { version = "2", optional = true }
52
- tokio = { version = "1.0", features = ["macros", "rt-multi-thread"], optional = true }
52
+ tokio = { version = "0.2", optional = true, features = ["macros"] }
53
53
  warp = { version = "0.2", default-features = false, optional = true }
54
54
  rocket = { version = "0.4.5", default-features = false, optional = true }
55
55
  axum = { version = "0.2.3", default-features = false, optional = true }
56
+ tokio-1 = { package = "tokio", version = "1.0", features = ["macros", "rt-multi-thread"], optional = true }
56
57
 
57
58
  [dev-dependencies]
58
59
  sha2 = "0.9"
@@ -65,7 +66,7 @@ include-exclude = ["rust-embed-impl/include-exclude"]
65
66
  nightly = ["rocket"]
66
67
  actix = ["actix-web", "mime_guess"]
67
68
  warp-ex = ["warp", "tokio", "mime_guess"]
68
- axum-ex = ["axum", "tokio", "mime_guess"]
69
+ axum-ex = ["axum", "tokio-1", "mime_guess"]
69
70
 
70
71
 
71
72
  [badges]
examples/axum.rs CHANGED
@@ -1,3 +1,4 @@
1
+ extern crate tokio_1 as tokio; // just for demo, axum needs tokio-1.x while warp needs tokio-0.2
1
2
  use std::convert::Infallible;
2
3
 
3
4
  use axum::{