Fix clippy warnings in peach-web
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2022-05-10 13:23:39 +02:00
parent 8a6ad4ad61
commit 3ae182caa9
2 changed files with 3 additions and 16 deletions

View File

@ -26,8 +26,7 @@ use std::{
};
use lazy_static::lazy_static;
use log::{debug, info};
use peach_lib::{config_manager, config_manager::YAML_PATH as PEACH_CONFIG};
use log::{info};
// crate-local dependencies
use config::Config;
@ -50,18 +49,6 @@ fn main() {
// initialize logger
env_logger::init();
// check if /var/lib/peachcloud/config.yml exists
if !std::path::Path::new(PEACH_CONFIG).exists() {
debug!("PeachCloud configuration file not found; loading default values");
// since we're in the intialisation phase, panic if the loading fails
let config =
config_manager::load_peach_config().expect("peachcloud configuration loading failed");
debug!("Saving default PeachCloud configuration values to file");
// this ensures a config file is created if it does not already exist
config_manager::save_peach_config(config).expect("peachcloud configuration saving failed");
}
// set ip address / hostname and port for the webserver
// defaults to "127.0.0.1:8000"
let addr_and_port = format!("{}:{}", CONFIG.addr, CONFIG.port);

View File

@ -13,8 +13,8 @@ pub fn build_template(request: &Request) -> PreEscaped<String> {
let (mut flash_name, mut flash_msg) = request.retrieve_flash();
// attempt to load peachcloud config file
let ssb_admins = match config_manager::load_peach_config() {
Ok(config) => Some(config.ssb_admin_ids),
let ssb_admins = match config_manager::get_ssb_admin_ids() {
Ok(ssb_admin_ids) => Some(ssb_admin_ids),
// note: this will overwrite any received flash cookie values
// TODO: find a way to include the `err` in the flash_msg
// currently produces an error because we end up with Some(String)