refactor(config): remove module name from function name
This commit is contained in:
parent
8ec8951315
commit
76a9695979
@ -55,7 +55,7 @@ pub struct Config {
|
|||||||
pub port: u16,
|
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).
|
let file = File::open(file_path).
|
||||||
with_context(|| format!("Failed to open configuration file '{}'",
|
with_context(|| format!("Failed to open configuration file '{}'",
|
||||||
file_path))?;
|
file_path))?;
|
||||||
|
@ -26,8 +26,6 @@ use clap::{Arg, App, crate_version};
|
|||||||
use rocket::routes;
|
use rocket::routes;
|
||||||
use rocket::config::{Config, Environment};
|
use rocket::config::{Config, Environment};
|
||||||
|
|
||||||
use crate::config::load_config;
|
|
||||||
|
|
||||||
const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json";
|
const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json";
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
@ -45,7 +43,7 @@ fn main() -> Result<()> {
|
|||||||
.value_of("config")
|
.value_of("config")
|
||||||
.unwrap_or(DEFAULT_CONFIG_FILE_PATH);
|
.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)?;
|
let context = context::Context::new(&config)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user