From 76a969597926dfbf48df33b7671ca98244c3d43c Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sat, 27 Feb 2021 21:07:15 +0100 Subject: [PATCH] refactor(config): remove module name from function name --- src/config.rs | 2 +- src/main.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index 6e171b2..ad32be7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -55,7 +55,7 @@ pub struct Config { pub port: u16, } -pub fn load_config(file_path: &str) -> Result { +pub fn load(file_path: &str) -> Result { let file = File::open(file_path). with_context(|| format!("Failed to open configuration file '{}'", file_path))?; diff --git a/src/main.rs b/src/main.rs index c5826a1..278ed20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,6 @@ use clap::{Arg, App, crate_version}; use rocket::routes; use rocket::config::{Config, Environment}; -use crate::config::load_config; - const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json"; fn main() -> Result<()> { @@ -45,7 +43,7 @@ fn main() -> Result<()> { .value_of("config") .unwrap_or(DEFAULT_CONFIG_FILE_PATH); - let config = load_config(config_file_path)?; + let config = config::load(config_file_path)?; let context = context::Context::new(&config)?;