From 1416e3e2853a81fba978689a2926a948ddf0c98f Mon Sep 17 00:00:00 2001 From: Kyosuke Fujimoto Date: Wed, 26 Feb 2025 08:44:56 +0900 Subject: [PATCH] Remove unnecessary fuctions --- src/config.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index c021dbd..6ff56d6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use std::{env, path::PathBuf}; +use std::env; use ratatui::style::Color; use serde::Deserialize; @@ -18,7 +18,7 @@ pub struct Config { impl Config { pub fn load() -> Config { - if let Some(path) = config_file_path() { + if let Ok(path) = env::var(CONFIG_PATH_ENV_VAR) { let content = std::fs::read_to_string(path).unwrap(); let config: OptionalConfig = toml::from_str(&content).unwrap(); config.into() @@ -28,10 +28,6 @@ impl Config { } } -fn config_file_path() -> Option { - env::var(CONFIG_PATH_ENV_VAR).map(PathBuf::from).ok() -} - #[optional(derives = [Deserialize])] #[derive(Debug, PartialEq, Eq)] pub struct ColorTheme {