Skip to content

Commit 1416e3e

Browse files
committed
Remove unnecessary fuctions
1 parent 02c0d64 commit 1416e3e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/config.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{env, path::PathBuf};
1+
use std::env;
22

33
use ratatui::style::Color;
44
use serde::Deserialize;
@@ -18,7 +18,7 @@ pub struct Config {
1818

1919
impl Config {
2020
pub fn load() -> Config {
21-
if let Some(path) = config_file_path() {
21+
if let Ok(path) = env::var(CONFIG_PATH_ENV_VAR) {
2222
let content = std::fs::read_to_string(path).unwrap();
2323
let config: OptionalConfig = toml::from_str(&content).unwrap();
2424
config.into()
@@ -28,10 +28,6 @@ impl Config {
2828
}
2929
}
3030

31-
fn config_file_path() -> Option<PathBuf> {
32-
env::var(CONFIG_PATH_ENV_VAR).map(PathBuf::from).ok()
33-
}
34-
3531
#[optional(derives = [Deserialize])]
3632
#[derive(Debug, PartialEq, Eq)]
3733
pub struct ColorTheme {

0 commit comments

Comments
 (0)