Correct stdout, updating lib and some clippy clean
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::{
|
||||
fs::{create_dir_all, File},
|
||||
io::{Read, Write},
|
||||
path::PathBuf,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use crate::ip_api::ip_location::IpLocation;
|
||||
@@ -60,15 +60,13 @@ pub fn get_from_cache(ip: &str) -> Option<IpLocation> {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_in_cache(path: &PathBuf) -> bool {
|
||||
fn is_in_cache(path: &Path) -> bool {
|
||||
path.is_file()
|
||||
}
|
||||
|
||||
fn get_cache_dir() -> Option<PathBuf> {
|
||||
let dir = ProjectDirs::from("com", "midefos", "open-meteo-cli");
|
||||
if dir.is_some() {
|
||||
let project_dir = dir.unwrap();
|
||||
|
||||
if let Some(project_dir) = &dir {
|
||||
let cache_dir = project_dir.cache_dir();
|
||||
if !cache_dir.exists() {
|
||||
let res = create_dir_all(cache_dir);
|
||||
@@ -76,7 +74,6 @@ fn get_cache_dir() -> Option<PathBuf> {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
Some(cache_dir.to_owned())
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user