Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
emilpriver committed Oct 7, 2024
1 parent e67ce2b commit d5a4f9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/bin/geni/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ pub struct GeniConfig {

pub fn load_config_file(project_name: &str) -> Result<GeniConfig> {
let file_path = "./geni.toml";
if !Path::new(file_path).exists() {
return bail!("{} don't exist", file_path);
if Path::new(file_path).try_exists().is_err() {
bail!("{} don't exist", file_path);
}

let contents = fs::read_to_string(file_path)?;
Expand All @@ -94,7 +94,9 @@ pub fn load_config_file(project_name: &str) -> Result<GeniConfig> {
let mut values_iter = v.iter();
match values_iter.find(|p| p.0 == "database_url") {
Some((_, database_url)) => {
let database_token = values_iter.find(|p| p.0 == "database_url").map(|(_, dt)| dt.to_string());
let database_token = values_iter
.find(|p| p.0 == "database_url")
.map(|(_, dt)| dt.to_string());
Ok(GeniConfig {
database_url: database_url.to_string(),
database_token,
Expand Down
1 change: 0 additions & 1 deletion src/lib/database_drivers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use anyhow::bail;
use serde::{Deserialize, Serialize};
use std::future::Future;
use std::pin::Pin;
use std::usize;

pub mod libsql;
pub mod maria;
Expand Down

0 comments on commit d5a4f9e

Please sign in to comment.