Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu-LAURENT39 committed Feb 12, 2024
1 parent 5be0451 commit caa8f89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use crate::utils;
use chrono::{DateTime, Datelike, Local, NaiveDate, NaiveDateTime, TimeZone, Utc};
use chrono_tz::{ParseError, Tz};
use clap::error::Result;
use directories::BaseDirs;
use serde::{Deserialize, Serialize};
use std::path::{self, Path, PathBuf};
use std::path::{self, PathBuf};
use std::str::FromStr;
use std::{fmt, fs};

Expand Down Expand Up @@ -213,7 +212,7 @@ pub enum LoadConfigError {
/// Load the given config file
pub fn load_config(path: &PathBuf) -> Result<ConfigFile, LoadConfigError> {
if path.is_file() {
let toml_str = fs::read_to_string(&path).map_err(LoadConfigError::IoError)?;
let toml_str = fs::read_to_string(path).map_err(LoadConfigError::IoError)?;
return toml::from_str(&toml_str)
.map_err(LoadConfigError::TomlError)
.map(|config| ConfigFile {
Expand Down
3 changes: 1 addition & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ pub fn find_prev_next_occurences(
#[cfg(test)]
mod tests {
use super::find_prev_next_occurences;
use chrono::{DateTime, Duration, Local, NaiveDate};
use chrono_tz::TZ_VARIANTS;
use chrono::NaiveDate;
use test_case::test_case;

#[test]
Expand Down

0 comments on commit caa8f89

Please sign in to comment.