diff --git a/frameworks/Rust/viz/Cargo.toml b/frameworks/Rust/viz/Cargo.toml index f28595febb5..b2e90cb4836 100644 --- a/frameworks/Rust/viz/Cargo.toml +++ b/frameworks/Rust/viz/Cargo.toml @@ -24,23 +24,28 @@ path = "src/main_diesel.rs" required-features = ["diesel", "diesel-async", "sailfish"] [dependencies] -viz = "0.8" -hyper = "1.0" +viz = "0.9" +hyper = "1.4" hyper-util = "0.1" atoi = "2.0" serde = { version = "1.0", features = ["derive"] } -nanorand = "0.7" rand = { version = "0.8", features = ["small_rng"] } thiserror = "1.0" futures-util = "0.3" +[target.'cfg(not(unix))'.dependencies] +nanorand = { version = "0.7" } + +[target.'cfg(unix)'.dependencies] +nanorand = { version = "0.7", features = ["getrandom"] } + tokio = { version = "1", features = ["full"] } tokio-postgres = { version = "0.7", optional = true } -sqlx = { version = "0.7", features = [ +sqlx = { version = "0.8", features = [ "postgres", "macros", "runtime-tokio", - "tls-native-tls" + "tls-native-tls", ], optional = true } diesel = { version = "2.2", default-features = false, features = [ "i-implement-a-third-party-backend-and-opt-into-breaking-changes", @@ -53,7 +58,7 @@ diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "74 yarte = { version = "0.15", features = ["bytes-buf", "json"], optional = true } markup = { version = "0.15", optional = true } v_htmlescape = { version = "0.15", optional = true } -sailfish = { version = "0.8", optional = true } +sailfish = { version = "0.9", optional = true } [profile.release] lto = true diff --git a/frameworks/Rust/viz/src/db_sqlx.rs b/frameworks/Rust/viz/src/db_sqlx.rs index af8322e9d1d..40c39290265 100644 --- a/frameworks/Rust/viz/src/db_sqlx.rs +++ b/frameworks/Rust/viz/src/db_sqlx.rs @@ -60,7 +60,7 @@ pub async fn get_world( id: i32, ) -> Result { let mut args = PgArguments::default(); - args.add(id); + let _ = args.add(id); let world = sqlx::query_as_with("SELECT id, randomnumber FROM World WHERE id = $1", args) @@ -86,8 +86,8 @@ pub async fn update_worlds( for w in &worlds { let mut args = PgArguments::default(); - args.add(w.randomnumber); - args.add(w.id); + let _ = args.add(w.randomnumber); + let _ = args.add(w.id); sqlx::query_with("UPDATE World SET randomNumber = $1 WHERE id = $2", args) .execute(&mut *conn) diff --git a/frameworks/Rust/viz/templates/fortune.stpl b/frameworks/Rust/viz/templates/fortune.stpl index eb1abe6a4fa..874b48cc6f5 100644 --- a/frameworks/Rust/viz/templates/fortune.stpl +++ b/frameworks/Rust/viz/templates/fortune.stpl @@ -4,7 +4,7 @@ - <% for item in items { %><% } %> + <% for item in self.items { %><% } %>
idmessage
<%= item.id %><%= &*item.message %>
<%= item.id %><%= &*item.message %>
- \ No newline at end of file +