refactor(config): remove module name from function name

This commit is contained in:
Philipp Matthias Schaefer 2021-02-27 21:07:15 +01:00
parent 8ec8951315
commit 76a9695979
2 changed files with 2 additions and 4 deletions

View File

@ -55,7 +55,7 @@ pub struct Config {
pub port: u16,
}
pub fn load_config(file_path: &str) -> Result<Config> {
pub fn load(file_path: &str) -> Result<Config> {
let file = File::open(file_path).
with_context(|| format!("Failed to open configuration file '{}'",
file_path))?;

View File

@ -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)?;