Skip to content

Commit

Permalink
Remove unnecessary fuctions
Browse files Browse the repository at this point in the history
  • Loading branch information
lusingander committed Feb 25, 2025
1 parent 02c0d64 commit 1416e3e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{env, path::PathBuf};
use std::env;

use ratatui::style::Color;
use serde::Deserialize;
Expand All @@ -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()
Expand All @@ -28,10 +28,6 @@ impl Config {
}
}

fn config_file_path() -> Option<PathBuf> {
env::var(CONFIG_PATH_ENV_VAR).map(PathBuf::from).ok()
}

#[optional(derives = [Deserialize])]
#[derive(Debug, PartialEq, Eq)]
pub struct ColorTheme {
Expand Down

0 comments on commit 1416e3e

Please sign in to comment.