refactor(examples): remove actix-web

This commit is contained in:
藍+85CD 2024-07-25 16:56:14 +08:00
parent ae8e601c4e
commit 2e1fbea95d
No known key found for this signature in database
GPG key ID: BCB0111111111111
2 changed files with 1 additions and 5 deletions

View file

@ -63,7 +63,6 @@ impl UrlVerifier for MyUrlVerifier {
pub enum Webserver { pub enum Webserver {
Axum, Axum,
ActixWeb,
} }
impl FromStr for Webserver { impl FromStr for Webserver {
@ -72,7 +71,6 @@ impl FromStr for Webserver {
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s { Ok(match s {
"axum" => Webserver::Axum, "axum" => Webserver::Axum,
"actix-web" => Webserver::ActixWeb,
_ => panic!("Invalid webserver parameter, must be either `axum` or `actix-web`"), _ => panic!("Invalid webserver parameter, must be either `axum` or `actix-web`"),
}) })
} }
@ -84,7 +82,7 @@ pub fn listen(
) -> Result<(), Error> { ) -> Result<(), Error> {
match webserver { match webserver {
Webserver::Axum => crate::axum::http::listen(config)?, Webserver::Axum => crate::axum::http::listen(config)?,
Webserver::ActixWeb => crate::actix_web::http::listen(config)?, // Webserver::ActixWeb => crate::actix_web::http::listen(config)?,
} }
Ok(()) Ok(())
} }

View file

@ -10,8 +10,6 @@ use std::{env::args, str::FromStr};
use tracing::log::{info, LevelFilter}; use tracing::log::{info, LevelFilter};
mod activities; mod activities;
#[cfg(feature = "actix-web")]
mod actix_web;
#[cfg(feature = "axum")] #[cfg(feature = "axum")]
mod axum; mod axum;
mod error; mod error;