features, cleanup and bug fixes #26
3 changed files with 6 additions and 9 deletions
fix some lint warnings
also reduce the use of conditional imports
commit
89f997ecec
|
|
@ -1,4 +1,3 @@
|
|||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::auth::login_provider::ldap::LdapLoginProviderConfig;
|
||||
|
|
@ -43,7 +42,7 @@ impl LoginProviderConfig {
|
|||
LoginProviderConfig::Disabled => Ok(None),
|
||||
#[cfg(feature = "dev_mode")]
|
||||
LoginProviderConfig::Development => {
|
||||
warn!("Using dev-login provider!");
|
||||
log::warn!("Using dev-login provider!");
|
||||
Ok(Some(User {
|
||||
name: user_name.to_owned(),
|
||||
}))
|
||||
|
|
|
|||
10
src/main.rs
10
src/main.rs
|
|
@ -13,8 +13,6 @@ use actix_web::middleware::{ErrorHandlers, NormalizePath, TrailingSlash};
|
|||
use actix_web::{get, web, App, HttpServer};
|
||||
use handlebars::Handlebars;
|
||||
use listenfd::ListenFd;
|
||||
#[cfg(feature = "dev_mode")]
|
||||
use log::info;
|
||||
use log::{error, LevelFilter, SetLoggerError};
|
||||
use route::error_handler;
|
||||
|
||||
|
|
@ -28,8 +26,6 @@ mod util;
|
|||
|
||||
// internal imports
|
||||
use crate::job_offers::{JobOffers, SubmissionLimiter};
|
||||
#[cfg(feature = "dev_mode")]
|
||||
use crate::server_config::OperationMode;
|
||||
use crate::server_config::ServerConfig;
|
||||
|
||||
// For reference see: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates
|
||||
|
|
@ -71,10 +67,12 @@ async fn run() -> Result<(), error::SeverInitializationError> {
|
|||
let job_offers = JobOffers::init_new(&server_config).await?;
|
||||
|
||||
hb.set_strict_mode(true);
|
||||
|
||||
#[cfg(feature = "dev_mode")]
|
||||
{
|
||||
info!("{:?}", server_config.args);
|
||||
info!("{:?}", server_config.config);
|
||||
use crate::server_config::OperationMode;
|
||||
log::info!("{:?}", server_config.args);
|
||||
log::info!("{:?}", server_config.config);
|
||||
hb.set_dev_mode(matches!(
|
||||
server_config.args.mode,
|
||||
OperationMode::Development
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ pub(crate) const JOBOFFER_REJECT_SUBMISSION_SUCCESS: &str = "job_offer/submissio
|
|||
pub(crate) const AUTH_LOGIN: &str = "auth/login";
|
||||
pub(crate) const LICENCES: &str = "licenses";
|
||||
|
||||
pub const EMAIL_PLAIN: &'static str = "email/plaintext";
|
||||
pub const EMAIL_PLAIN: &str = "email/plaintext";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue