Skip to content

Commit cae4e43

Browse files
authored
[Rust/Viz] viz v0.9.0 (#9307)
1 parent 9c41401 commit cae4e43

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

frameworks/Rust/viz/Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,28 @@ path = "src/main_diesel.rs"
2424
required-features = ["diesel", "diesel-async", "sailfish"]
2525

2626
[dependencies]
27-
viz = "0.8"
28-
hyper = "1.0"
27+
viz = "0.9"
28+
hyper = "1.4"
2929
hyper-util = "0.1"
3030
atoi = "2.0"
3131
serde = { version = "1.0", features = ["derive"] }
32-
nanorand = "0.7"
3332
rand = { version = "0.8", features = ["small_rng"] }
3433
thiserror = "1.0"
3534
futures-util = "0.3"
3635

36+
[target.'cfg(not(unix))'.dependencies]
37+
nanorand = { version = "0.7" }
38+
39+
[target.'cfg(unix)'.dependencies]
40+
nanorand = { version = "0.7", features = ["getrandom"] }
41+
3742
tokio = { version = "1", features = ["full"] }
3843
tokio-postgres = { version = "0.7", optional = true }
39-
sqlx = { version = "0.7", features = [
44+
sqlx = { version = "0.8", features = [
4045
"postgres",
4146
"macros",
4247
"runtime-tokio",
43-
"tls-native-tls"
48+
"tls-native-tls",
4449
], optional = true }
4550
diesel = { version = "2.2", default-features = false, features = [
4651
"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
5358
yarte = { version = "0.15", features = ["bytes-buf", "json"], optional = true }
5459
markup = { version = "0.15", optional = true }
5560
v_htmlescape = { version = "0.15", optional = true }
56-
sailfish = { version = "0.8", optional = true }
61+
sailfish = { version = "0.9", optional = true }
5762

5863
[profile.release]
5964
lto = true

frameworks/Rust/viz/src/db_sqlx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub async fn get_world(
6060
id: i32,
6161
) -> Result<World, PgError> {
6262
let mut args = PgArguments::default();
63-
args.add(id);
63+
let _ = args.add(id);
6464

6565
let world =
6666
sqlx::query_as_with("SELECT id, randomnumber FROM World WHERE id = $1", args)
@@ -86,8 +86,8 @@ pub async fn update_worlds(
8686

8787
for w in &worlds {
8888
let mut args = PgArguments::default();
89-
args.add(w.randomnumber);
90-
args.add(w.id);
89+
let _ = args.add(w.randomnumber);
90+
let _ = args.add(w.id);
9191

9292
sqlx::query_with("UPDATE World SET randomNumber = $1 WHERE id = $2", args)
9393
.execute(&mut *conn)

frameworks/Rust/viz/templates/fortune.stpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<body>
55
<table>
66
<tr><th>id</th><th>message</th></tr>
7-
<% for item in items { %><tr><td><%= item.id %></td><td><%= &*item.message %></td></tr><% } %>
7+
<% for item in self.items { %><tr><td><%= item.id %></td><td><%= &*item.message %></td></tr><% } %>
88
</table>
99
</body>
10-
</html>
10+
</html>

0 commit comments

Comments
 (0)