Skip to content

Commit

Permalink
clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonShin committed Jul 25, 2024
1 parent 02e86c8 commit 97b7039
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/common/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::common::dotenv::Dotenv;
use crate::common::lazy::CLI_ARGS;
use crate::common::types::{DatabaseType, LogLevel};
use crate::common::logger::*;
use regex::Regex;
use serde;
use serde::{Deserialize, Serialize};
Expand Down
7 changes: 3 additions & 4 deletions src/common/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::string::ToString;

// Common error messages
pub static DB_CONN_POOL_RETRIEVE_ERROR: &'static str = "Failed to retrieve a connection from the pool. Increase the pool size and try again";
pub static DB_SCHEME_READ_ERROR: &'static str = "Failed to read the database schema to retrieve details. Please raise the issue on https://github.com/JasonShin/sqlx-ts/issues";
pub static DB_CONN_FROM_LOCAL_CACHE_ERROR: &'static str = "Failed to retrieve a connection from local cache, check the database name annotated in your query and connections config in your configuration file";
pub static DB_CONN_POOL_RETRIEVE_ERROR: &str = "Failed to retrieve a connection from the pool. Increase the pool size and try again";
pub static DB_SCHEME_READ_ERROR: &str = "Failed to read the database schema to retrieve details. Please raise the issue on https://github.com/JasonShin/sqlx-ts/issues";
pub static DB_CONN_FROM_LOCAL_CACHE_ERROR: &str = "Failed to retrieve a connection from local cache, check the database name annotated in your query and connections config in your configuration file";

2 changes: 1 addition & 1 deletion src/common/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lazy_static! {
let mut cache = HashMap::new();
for connection in CONFIG.connections.keys() {
let connection_config = CONFIG.connections.get(connection)
.expect(format!("Failed to find a correct connection from the configuration - {connection}").as_str());
.unwrap_or_else(|| panic!("Failed to find a correct connection from the configuration - {connection}"));
let db_type = connection_config.db_type.to_owned();
let conn = match db_type {
DatabaseType::Mysql => {
Expand Down
3 changes: 0 additions & 3 deletions src/common/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ macro_rules! debug {
});
}

pub(crate) use debug;

macro_rules! info {
($arg:tt) => ({
Expand All @@ -50,7 +49,6 @@ macro_rules! info {
});
}

use colored::Colorize;
pub(crate) use info;

macro_rules! warning {
Expand Down Expand Up @@ -102,4 +100,3 @@ macro_rules! error {
});
}

pub(crate) use error;

0 comments on commit 97b7039

Please sign in to comment.