server: Limit the scope of a mutable variable

This commit is contained in:
Tristan Daniël Maat 2022-10-04 17:57:59 +01:00
parent 4fb60f251a
commit 73b9fbf612
Signed by: tlater
GPG key ID: 49670FD774E43268

View file

@ -44,8 +44,11 @@ struct SharedData<'a> {
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
let config = {
let mut config = Config::parse(); let mut config = Config::parse();
config.template_directory = config.template_directory.canonicalize()?; config.template_directory = config.template_directory.canonicalize()?;
config
};
env_logger::Builder::new() env_logger::Builder::new()
.filter_level(if config.dev_mode { .filter_level(if config.dev_mode {