From 2a4df30c637b3fa396844577d3bc78f806a160a0 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 20 Nov 2023 18:37:11 +0000 Subject: [PATCH] chore(rt): remove hyper example --- actix-rt/Cargo.toml | 1 - actix-rt/examples/hyper.rs | 29 ----------------------------- 2 files changed, 30 deletions(-) delete mode 100644 actix-rt/examples/hyper.rs diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 49c96eae..f3993606 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -37,4 +37,3 @@ tokio-uring = { version = "0.4", optional = true } [dev-dependencies] tokio = { version = "1.23.1", features = ["full"] } -hyper = { version = "0.14.10", default-features = false, features = ["server", "tcp", "http1"] } diff --git a/actix-rt/examples/hyper.rs b/actix-rt/examples/hyper.rs deleted file mode 100644 index 41c5a7d8..00000000 --- a/actix-rt/examples/hyper.rs +++ /dev/null @@ -1,29 +0,0 @@ -use std::{convert::Infallible, net::SocketAddr}; - -use hyper::{ - service::{make_service_fn, service_fn}, - Body, Request, Response, Server, -}; - -async fn handle(_req: Request) -> Result, Infallible> { - Ok(Response::new(Body::from("Hello World"))) -} - -fn main() { - actix_rt::System::with_tokio_rt(|| { - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .unwrap() - }) - .block_on(async { - let make_service = - make_service_fn(|_conn| async { Ok::<_, Infallible>(service_fn(handle)) }); - - let server = Server::bind(&SocketAddr::from(([127, 0, 0, 1], 3000))).serve(make_service); - - if let Err(err) = server.await { - eprintln!("server error: {}", err); - } - }) -}