We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02c0d64 commit 1416e3eCopy full SHA for 1416e3e
1 file changed
src/config.rs
@@ -1,4 +1,4 @@
1
-use std::{env, path::PathBuf};
+use std::env;
2
3
use ratatui::style::Color;
4
use serde::Deserialize;
@@ -18,7 +18,7 @@ pub struct Config {
18
19
impl Config {
20
pub fn load() -> Config {
21
- if let Some(path) = config_file_path() {
+ if let Ok(path) = env::var(CONFIG_PATH_ENV_VAR) {
22
let content = std::fs::read_to_string(path).unwrap();
23
let config: OptionalConfig = toml::from_str(&content).unwrap();
24
config.into()
@@ -28,10 +28,6 @@ impl Config {
28
}
29
30
31
-fn config_file_path() -> Option<PathBuf> {
32
- env::var(CONFIG_PATH_ENV_VAR).map(PathBuf::from).ok()
33
-}
34
-
35
#[optional(derives = [Deserialize])]
36
#[derive(Debug, PartialEq, Eq)]
37
pub struct ColorTheme {
0 commit comments