Skip to content

Commit

Permalink
[rust/viz] Upgrade to v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 28, 2024
1 parent bca3822 commit ed28dd4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
11 changes: 7 additions & 4 deletions frameworks/Rust/viz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ path = "src/main_diesel.rs"
required-features = ["diesel", "diesel-async", "sailfish"]

[dependencies]
viz = "0.9"
hyper = "1.4"
viz = "0.10"
hyper = "1.5"
hyper-util = "0.1"
http-body-util = "0.1"
atoi = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
mime = "0.3"
rand = { version = "0.8", features = ["small_rng"] }
thiserror = "1.0"
thiserror = "2.0"
futures-util = "0.3"

[target.'cfg(not(unix))'.dependencies]
Expand All @@ -50,7 +53,7 @@ sqlx = { version = "0.8", features = [
diesel = { version = "2.2", default-features = false, features = [
"i-implement-a-third-party-backend-and-opt-into-breaking-changes",
], optional = true }
diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "74867bd", version = "0.4", default-features = false, features = [
diesel-async = { version = "0.5", default-features = false, features = [
"postgres",
"bb8",
], optional = true }
Expand Down
14 changes: 10 additions & 4 deletions frameworks/Rust/viz/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use serde::Serialize;
use viz::{
header::{HeaderValue, SERVER},
Error, Request, Response, ResponseExt, Result, Router,
Bytes, Error, Request, Response, ResponseExt, Result, Router,
};

mod server;
Expand All @@ -22,9 +22,15 @@ async fn plaintext(_: Request) -> Result<Response> {
}

async fn json(_: Request) -> Result<Response> {
let mut res = Response::json(Message {
message: "Hello, World!",
})?;
let mut res = Response::with(
http_body_util::Full::new(Bytes::from(
serde_json::to_vec(&Message {
message: "Hello, World!",
})
.unwrap(),
)),
mime::APPLICATION_JSON.as_ref(),
);
res.headers_mut()
.insert(SERVER, HeaderValue::from_static("Viz"));
Ok(res)
Expand Down
4 changes: 1 addition & 3 deletions frameworks/Rust/viz/viz-diesel.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.79

RUN apt-get update -yqq && apt-get install -yqq cmake g++
FROM rust:1.83

ADD ./ /viz
WORKDIR /viz
Expand Down
4 changes: 1 addition & 3 deletions frameworks/Rust/viz/viz-pg.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.79

RUN apt-get update -yqq && apt-get install -yqq cmake g++
FROM rust:1.83

ADD ./ /viz
WORKDIR /viz
Expand Down
4 changes: 1 addition & 3 deletions frameworks/Rust/viz/viz-sqlx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.79

RUN apt-get update -yqq && apt-get install -yqq cmake g++
FROM rust:1.83

ADD ./ /viz
WORKDIR /viz
Expand Down
4 changes: 1 addition & 3 deletions frameworks/Rust/viz/viz.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM rust:1.79

RUN apt-get update -yqq && apt-get install -yqq cmake g++
FROM rust:1.83

ADD ./ /viz
WORKDIR /viz
Expand Down

0 comments on commit ed28dd4

Please sign in to comment.