Skip to content

Commit 06c8765

Browse files
committed
refactor: remove unused test configuration functions and add dead code allowance
1 parent 23c5a76 commit 06c8765

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

src-tauri/src/fileflow/stuct/config/save_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ impl SaveConfig {
5454
mod tests {
5555
use super::*;
5656

57+
#[allow(dead_code)]
5758
fn get_test_config() -> SaveConfig {
5859
SaveConfig {
5960
config_name: "config_name".into(),

src-tauri/src/tests/utils_tests.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use csv::Writer;
22
use fileflow::fileflow::enums::database_engine::DatabaseEngine;
33
use fileflow::fileflow::stuct::config::db_config::DatabaseConfig;
4-
use fileflow::fileflow::stuct::config::save_config::SaveConfig;
54
use std::error::Error;
65
use std::fs::File;
76
use std::path::PathBuf;
@@ -61,29 +60,6 @@ pub fn get_test_maridb_config() -> DatabaseConfig {
6160
sqlite_file_path: String::new(),
6261
}
6362
}
64-
/// Get a test save configuration
65-
pub fn get_test_save_config(config_name: &str) -> SaveConfig {
66-
SaveConfig {
67-
config_name: config_name.into(),
68-
db_driver: DatabaseEngine::SQLite,
69-
db_host: String::new(),
70-
port: String::new(),
71-
username: String::new(),
72-
password: String::new(),
73-
db_name: "test_db".into(),
74-
sqlite_file_path: String::new(),
75-
}
76-
}
77-
78-
/// Delete the configuration file with the given file name
79-
pub fn delete_config_file(config_file_name: &str) -> Result<(), Box<dyn Error>> {
80-
if !std::path::Path::new(&config_file_name).exists() {
81-
println!("File does not exist");
82-
Err("Failed to create SQLite file")?;
83-
}
84-
std::fs::remove_file(config_file_name).expect("Failed to remove SQLite file");
85-
Ok(())
86-
}
8763

8864
/// Create a test SQLite database file if it does not exist and return the file path
8965
pub fn create_test_db(db_name: &str) -> String {

0 commit comments

Comments
 (0)