From ef13969220aaa62d4c2340032d8777520dbdb4f0 Mon Sep 17 00:00:00 2001 From: netroby <66301650+netroby@users.noreply.github.com> Date: Sun, 25 Apr 2021 20:15:27 +0800 Subject: [PATCH] Bump tera version to 1.8.0, print the listening port to cli (#421) Co-authored-by: ZhiFeng Hu --- Cargo.lock | 117 +++++++++++++++++++++--------- template_engines/tera/Cargo.toml | 2 +- template_engines/tera/src/main.rs | 1 + 3 files changed, 86 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db5057c..6ca53a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,7 +203,7 @@ dependencies = [ "mime", "percent-encoding", "pin-project 1.0.2", - "rand", + "rand 0.7.3", "regex", "serde 1.0.117", "serde_json", @@ -286,7 +286,7 @@ dependencies = [ "derive_more", "futures-util", "log", - "rand", + "rand 0.7.3", "redis-async", "serde 1.0.117", "serde_json", @@ -1134,7 +1134,7 @@ dependencies = [ "mime", "openssl", "percent-encoding", - "rand", + "rand 0.7.3", "rustls", "serde 1.0.117", "serde_json", @@ -1169,7 +1169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "721c249ab59cbc483ad4294c9ee2671835c1e43e9ffc277e6b4ecfef733cfdc5" dependencies = [ "instant", - "rand", + "rand 0.7.3", ] [[package]] @@ -1384,7 +1384,7 @@ dependencies = [ "hex", "lazy_static", "linked-hash-map 0.5.3", - "rand", + "rand 0.7.3", "serde 1.0.117", "serde_json", ] @@ -1694,7 +1694,7 @@ dependencies = [ "hkdf", "hmac 0.10.1", "percent-encoding", - "rand", + "rand 0.7.3", "sha2 0.9.2", "time 0.2.23", "version_check 0.9.2", @@ -1707,7 +1707,7 @@ dependencies = [ "actix-identity", "actix-web", "env_logger 0.8.2", - "rand", + "rand 0.7.3", ] [[package]] @@ -2178,7 +2178,7 @@ dependencies = [ "actix-web", "derive_more", "env_logger 0.8.2", - "rand", + "rand 0.7.3", ] [[package]] @@ -2477,6 +2477,17 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", +] + [[package]] name = "ghash" version = "0.3.0" @@ -2507,9 +2518,9 @@ dependencies = [ [[package]] name = "globwalk" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "178270263374052c40502e9f607134947de75302c1348d1a0e31db67c1691446" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" dependencies = [ "bitflags", "ignore", @@ -3446,7 +3457,7 @@ dependencies = [ "lexical", "num-bigint", "num-traits 0.2.14", - "rand", + "rand 0.7.3", "regex", "rust_decimal", "serde 1.0.117", @@ -3805,7 +3816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ "phf_shared", - "rand", + "rand 0.7.3", ] [[package]] @@ -3931,7 +3942,7 @@ dependencies = [ "hmac 0.9.0", "md5", "memchr", - "rand", + "rand 0.7.3", "sha2 0.9.2", "stringprep", ] @@ -4110,14 +4121,26 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.15", "libc", - "rand_chacha", - "rand_core", - "rand_hc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", "rand_pcg", ] +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.2", + "rand_hc 0.3.0", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -4125,7 +4148,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.2", ] [[package]] @@ -4134,7 +4167,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.15", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom 0.2.2", ] [[package]] @@ -4143,7 +4185,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.2", ] [[package]] @@ -4152,7 +4203,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ - "rand_core", + "rand_core 0.5.1", ] [[package]] @@ -4200,7 +4251,7 @@ dependencies = [ "actix-session", "actix-web", "env_logger 0.8.2", - "rand", + "rand 0.7.3", "serde 1.0.117", "serde_json", "time 0.2.23", @@ -4229,7 +4280,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", + "getrandom 0.1.15", "redox_syscall", "rust-argon2", ] @@ -5237,7 +5288,7 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if 0.1.10", "libc", - "rand", + "rand 0.7.3", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -5307,9 +5358,9 @@ dependencies = [ [[package]] name = "tera" -version = "1.5.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1381c83828bedd5ce4e59473110afa5381ffe523406d9ade4b77c9f7be70ff9a" +checksum = "b64b021b8d3ab1f59ceae9e6cd1c26c8e7ce0322a9ebfff6c0e22b3b66938935" dependencies = [ "chrono", "chrono-tz", @@ -5319,7 +5370,7 @@ dependencies = [ "percent-encoding", "pest", "pest_derive", - "rand", + "rand 0.8.3", "regex", "serde 1.0.117", "serde_json", @@ -5675,7 +5726,7 @@ dependencies = [ "idna", "lazy_static", "log", - "rand", + "rand 0.7.3", "smallvec", "thiserror", "tokio", @@ -5725,7 +5776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand", + "rand 0.7.3", "static_assertions 1.1.0", ] @@ -5924,7 +5975,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "rand", + "rand 0.7.3", "serde 1.0.117", ] @@ -6274,7 +6325,7 @@ dependencies = [ "env_logger 0.8.2", "futures", "log", - "rand", + "rand 0.7.3", ] [[package]] @@ -6289,7 +6340,7 @@ dependencies = [ "bytes 0.5.6", "env_logger 0.8.2", "futures", - "rand", + "rand 0.7.3", "serde 1.0.117", "serde_json", ] @@ -6307,7 +6358,7 @@ dependencies = [ "bytes 0.5.6", "env_logger 0.8.2", "futures", - "rand", + "rand 0.7.3", "serde 1.0.117", "serde_json", "tokio", diff --git a/template_engines/tera/Cargo.toml b/template_engines/tera/Cargo.toml index d21fc1c..4216718 100644 --- a/template_engines/tera/Cargo.toml +++ b/template_engines/tera/Cargo.toml @@ -6,6 +6,6 @@ edition = "2018" [dependencies] env_logger = "0.8" -tera = "1.0" +tera = "1.8.0" actix-http = "2" actix-web = "3" diff --git a/template_engines/tera/src/main.rs b/template_engines/tera/src/main.rs index 7507837..14f2bfa 100644 --- a/template_engines/tera/src/main.rs +++ b/template_engines/tera/src/main.rs @@ -31,6 +31,7 @@ async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_web=info"); env_logger::init(); + println!("Listening on: 127.0.0.1:8080, open browser and visit have a try!"); HttpServer::new(|| { let tera = Tera::new(concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*")).unwrap();