Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): hyper v1.4 #147

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
CARGO_PROFILE_TEST_BUILD_OVERRIDE_DEBUG: true
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
RUSTFLAGS: -D warnings
RUSTFLAGS: -D warnings -A clippy::needless_return
RUSTDOCFLAGS: -D warnings

jobs:
Expand Down
120 changes: 63 additions & 57 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
[workspace]
resolver = "2"
members = [
"viz",
"viz-core",
"viz-handlers",
"viz-macros",
"viz-router",
"viz-tower",
"viz-smol",
"viz-test",

"examples/hello-world",
"examples/unix-socket",
"examples/static-files/embed",
"examples/static-files/serve",
"examples/static-files/include-dir",
"examples/limits",
"examples/forms/form",
"examples/forms/multipart",
"examples/websocket-chat",
"examples/sse",
"examples/session",
"examples/csrf",
"examples/cors",
"examples/rustls",
"examples/static-routes",
"examples/routing/todos",
"examples/routing/openapi",
"examples/otel/*",
"examples/compression",
"examples/templates/*",
"examples/tracing",
"examples/graceful-shutdown",
"examples/databases/*",
"examples/htmlx",
"examples/tower",
"examples/smol",
"viz",
"viz-core",
"viz-handlers",
"viz-macros",
"viz-router",
"viz-tower",
"viz-smol",
"viz-test",

"examples/hello-world",
"examples/unix-socket",
"examples/static-files/embed",
"examples/static-files/serve",
"examples/static-files/include-dir",
"examples/limits",
"examples/forms/form",
"examples/forms/multipart",
"examples/websocket-chat",
"examples/sse",
"examples/session",
"examples/csrf",
"examples/cors",
"examples/rustls",
"examples/static-routes",
"examples/routing/todos",
"examples/routing/openapi",
"examples/otel/*",
"examples/compression",
"examples/templates/*",
"examples/tracing",
"examples/graceful-shutdown",
"examples/databases/*",
"examples/htmlx",
"examples/tower",
"examples/smol",
]

[workspace.package]
Expand All @@ -61,7 +61,7 @@ viz-smol = { version = "0.1.9", path = "viz-smol" }

anyhow = "1.0"
async-trait = "0.1"
bytes = "1.6"
bytes = "1.7"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
Expand All @@ -80,49 +80,55 @@ sessions-memory = "0.6"
# http
headers = "0.4"
http = "1.1"
http-body = "1"
http-body = "1.0"
http-body-util = "0.1"
hyper = { version = "1.3" }
hyper-util = { version = "0.1.5", features = ["server", "tokio" ] }
hyper = { version = "1.4" }
hyper-util = { version = "0.1.9", features = ["server", "tokio"] }
mime = "0.3"
mime_guess = "2.0"
percent-encoding = "2.3"

hex = "0.4"
rust-embed = "8"
rust-embed = "8.5"

futures-util = "0.3"
rustls-pemfile = "2.0"
tokio = { version = "1.38", features = ["net"] }
tokio-native-tls = "0.3"
tokio-rustls = "0.26"
tokio-stream = "0.1"
tokio-tungstenite = "0.21"
tokio-tungstenite = "0.24"
tokio-util = "0.7"

# TLS
rustls-pemfile = "2.1"
tokio-native-tls = "0.3"
tokio-rustls = "0.26"

# OpenTelemetry
opentelemetry = { version = "0.23", default-features = false }
opentelemetry_sdk = { version = "0.23", default-features = false }
opentelemetry-prometheus = { version = "0.16", features = [
"prometheus-encoding",
opentelemetry = { version = "0.24", default-features = false }
opentelemetry_sdk = { version = "0.24", default-features = false }
opentelemetry-otlp = { version = "0.17", default-features = false, features = [
"trace",
"http-proto",
] }
opentelemetry-prometheus = { version = "0.17", features = [
"prometheus-encoding",
] }
opentelemetry-semantic-conventions = { version = "0.15" }
opentelemetry-semantic-conventions = { version = "0.16" }
prometheus = "0.13"

# Tracing
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Tower
tower = "0.4"
tower-http = "0.5"
tower = "0.5"
tower-http = "0.6"

# Soml
async-channel = "2.3"
async-executor = "1.11"
async-executor = "1.13"
async-io = "2.3"
async-net = "2.0"
smol-hyper = "0.1.1"
smol-hyper = "0.1"
smol-macros = "0.1"
macro_rules_attribute = "0.2"
futures-lite = { version = "2.3", default-features = false, features = ["std"] }
Expand All @@ -141,22 +147,22 @@ debug = false

[workspace.lints.rust]
unsafe_code = "forbid"
# rust_2018_idioms = "warn"
single_use_lifetimes = "warn"
non_ascii_idents = "warn"
non_local_definitions = 'warn'
rust_2018_idioms = { level = "warn", priority = -1 }
unreachable_pub = "warn"
unexpected_cfgs = { level = "warn", check-cfg = [] }
missing_debug_implementations = "warn"
missing_docs = "warn"

[workspace.lints.clippy]
all = "warn" # Downgrade deny-by-default lints
all = "warn" # Downgrade deny-by-default lints
pedantic = "warn"
missing_errors_doc = { level = "allow", priority = 1 }
module_name_repetitions = { level = "allow", priority = 1 }
too_many_lines = { level = "allow", priority = 1 }
type_complexity = { level = "allow", priority = 1 }
lint_groups_priority = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12270
lint_groups_priority = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12270

[workspace.lints.rustdoc]
private_intra_doc_links = 'allow'
2 changes: 0 additions & 2 deletions examples/compression/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
2 changes: 0 additions & 2 deletions examples/cors/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{get, middleware::cors, serve, Method, Request, Result, Router};
Expand Down
2 changes: 0 additions & 2 deletions examples/csrf/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::{net::SocketAddr, time::Duration};
use tokio::net::TcpListener;

Expand Down
5 changes: 4 additions & 1 deletion examples/databases/sea-orm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ viz = { workspace = true, features = ["serve"] }
serde.workspace = true

tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
sea-orm = { version = "0.12", features = ["runtime-tokio-rustls", "sqlx-sqlite"] }
sea-orm = { version = "1.0", features = [
"runtime-tokio-rustls",
"sqlx-sqlite",
] }

[lints]
workspace = true
2 changes: 0 additions & 2 deletions examples/databases/sea-orm/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

//! `SeaOrm` example for Viz framework.
use sea_orm_example::{api, db::init_db};
use std::{env, net::SocketAddr, path::PathBuf};
Expand Down
2 changes: 0 additions & 2 deletions examples/forms/form/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use serde::{Deserialize, Serialize};
use std::net::SocketAddr;
use tokio::net::TcpListener;
Expand Down
10 changes: 5 additions & 5 deletions examples/forms/multipart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ viz.workspace = true

futures-util.workspace = true
tokio = { workspace = true, features = [
"fs",
"io-util",
"macros",
"rt-multi-thread",
"fs",
"io-util",
"macros",
"rt-multi-thread",
] }

tempfile = "3.10"
tempfile = "3.0"
2 changes: 0 additions & 2 deletions examples/forms/multipart/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use futures_util::TryStreamExt;
use std::{fs::File, net::SocketAddr};
use tempfile::tempdir;
Expand Down
2 changes: 0 additions & 2 deletions examples/graceful-shutdown/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;
use tokio::signal;
Expand Down
2 changes: 0 additions & 2 deletions examples/hello-world/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::{net::SocketAddr, str::FromStr};
use tokio::net::TcpListener;
use viz::{serve, Request, Result, Router};
Expand Down
2 changes: 1 addition & 1 deletion examples/htmlx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

handlebars = { version = "5", features = ["dir_source"] }
handlebars = { version = "6.0", features = ["dir_source"] }
2 changes: 0 additions & 2 deletions examples/htmlx/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// #![deny(warnings)]

use handlebars::{DirectorySourceOptions, Handlebars};
use serde::{Deserialize, Serialize};
use serde_json::json;
Expand Down
2 changes: 0 additions & 2 deletions examples/limits/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{
Expand Down
2 changes: 0 additions & 2 deletions examples/otel/metrics/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
10 changes: 8 additions & 2 deletions examples/otel/tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ viz = { workspace = true, features = ["otel-tracing"] }

tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
opentelemetry.workspace = true
opentelemetry_sdk = { workspace = true, features = ["trace", "rt-tokio-current-thread"] }
opentelemetry-otlp = { version = "0.16", default-features = false, features = ["trace", "http-proto"] }
opentelemetry_sdk = { workspace = true, features = [
"trace",
"rt-tokio-current-thread",
] }
opentelemetry-otlp = { workspace = true, default-features = false, features = [
"trace",
"http-proto",
] }
9 changes: 4 additions & 5 deletions examples/otel/tracing/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#![deny(warnings)]
#![allow(clippy::unused_async)]

use opentelemetry::global;
use opentelemetry_sdk::{
runtime::TokioCurrentThread,
{propagation::TraceContextPropagator, trace::Tracer},
{propagation::TraceContextPropagator, trace::TracerProvider},
};
use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{middleware::otel, serve, Request, Result, Router};

fn init_tracer() -> Tracer {
fn init_tracer_provider() -> TracerProvider {
global::set_text_map_propagator(TraceContextPropagator::new());
opentelemetry_otlp::new_pipeline()
.tracing()
Expand All @@ -29,12 +28,12 @@ async fn main() -> Result<()> {
let listener = TcpListener::bind(addr).await?;
println!("listening on http://{addr}");

let tracer = init_tracer();
let tracer_provider = init_tracer_provider();

let app = Router::new()
.get("/", index)
.get("/:username", index)
.with(otel::tracing::Config::new(tracer));
.with(otel::tracing::Config::new(tracer_provider, None));

if let Err(e) = serve(listener, app).await {
println!("{e}");
Expand Down
4 changes: 2 additions & 2 deletions examples/routing/openapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

utoipa = "4"
utoipa-swagger-ui = "7"
utoipa = "4.0"
utoipa-swagger-ui = "7.0"
1 change: 0 additions & 1 deletion examples/routing/openapi/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
#![allow(clippy::unused_async)]
#![allow(clippy::needless_pass_by_value)]

Expand Down
2 changes: 0 additions & 2 deletions examples/routing/todos/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::{
net::SocketAddr,
sync::{Arc, Mutex, PoisonError},
Expand Down
2 changes: 0 additions & 2 deletions examples/rustls/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::{net::SocketAddr, sync::Arc};
use tokio::net::TcpListener;
use viz::{get, serve, tls, Request, Result, Router};
Expand Down
2 changes: 0 additions & 2 deletions examples/session/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
2 changes: 0 additions & 2 deletions examples/sse/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use futures_util::StreamExt;
use std::{net::SocketAddr, sync::Arc};
use systemstat::{Platform, System};
Expand Down
2 changes: 0 additions & 2 deletions examples/static-files/embed/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{handlers::embed, serve, Result, Router, StatusCode};
Expand Down
1 change: 0 additions & 1 deletion examples/static-files/include-dir/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![deny(warnings)]
#![allow(clippy::unused_async)]

use http_body_util::Full;
Expand Down
2 changes: 0 additions & 2 deletions examples/static-files/serve/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![deny(warnings)]

use std::{env, net::SocketAddr, path::PathBuf};
use tokio::net::TcpListener;
use viz::{handlers::serve, serve, Request, Response, ResponseExt, Result, Router};
Expand Down
Loading
Loading