From b91e424ab4a2131269a3d8797ce4aa2b062a931c Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 30 Dec 2022 16:30:16 +0000 Subject: [PATCH] address clippy lints --- Cargo.lock | 1 + background-jobs/src/persistent_jobs.rs | 11 +++++------ background-jobs/src/routes.rs | 2 +- basics/nested-routing/Cargo.toml | 7 ++++--- basics/nested-routing/src/{bin => }/main.rs | 5 +++-- 5 files changed, 14 insertions(+), 12 deletions(-) rename basics/nested-routing/src/{bin => }/main.rs (70%) diff --git a/Cargo.lock b/Cargo.lock index 55e74f9..859891c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4644,6 +4644,7 @@ version = "1.0.0" dependencies = [ "actix-web", "env_logger", + "log", "serde", "serde_json", ] diff --git a/background-jobs/src/persistent_jobs.rs b/background-jobs/src/persistent_jobs.rs index ad1d793..bb6df6c 100644 --- a/background-jobs/src/persistent_jobs.rs +++ b/background-jobs/src/persistent_jobs.rs @@ -5,10 +5,8 @@ use std::time::Duration; use apalis::{prelude::*, redis::RedisStorage}; use rand::Rng as _; use serde::{Deserialize, Serialize}; -use tokio::task::JoinHandle; #[derive(Debug, Deserialize, Serialize)] - pub(crate) struct Email { to: String, } @@ -51,11 +49,12 @@ pub(crate) async fn start_processing_email_queue() -> anyhow::Result std::io::Result<()> { - std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info"); - env_logger::init(); + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + log::info!("starting HTTP server at http://localhost:8080"); HttpServer::new(|| { App::new()