Skip to content

Commit

Permalink
Merge pull request #216 from ReagentX/feat/cs/move-export-type
Browse files Browse the repository at this point in the history
Move export type module
  • Loading branch information
ReagentX committed Nov 28, 2023
2 parents 9bf81fa + 903ed73 commit 4c68927
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion imessage-database/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

pub mod dates;
pub mod dirs;
pub mod export_type;
pub mod output;
pub mod platform;
pub mod plist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Display for ExportType {

#[cfg(test)]
mod tests {
use crate::util::export_type::ExportType;
use crate::app::export_type::ExportType;

#[test]
fn can_parse_html_any_case() {
Expand Down
3 changes: 2 additions & 1 deletion imessage-exporter/src/app/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod converter;
pub mod attachment_manager;
pub mod converter;
pub mod error;
pub mod export_type;
pub mod options;
pub mod progress;
pub mod runtime;
Expand Down
16 changes: 10 additions & 6 deletions imessage-exporter/src/app/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ use imessage_database::{
tables::{attachment::DEFAULT_ATTACHMENT_ROOT, table::DEFAULT_PATH_IOS},
util::{
dirs::{default_db_path, home},
export_type::ExportType,
platform::Platform,
query_context::QueryContext,
},
};

use crate::app::{attachment_manager::AttachmentManager, error::RuntimeError};
use crate::app::{
attachment_manager::AttachmentManager, error::RuntimeError, export_type::ExportType,
};

/// Default export directory name
pub const DEFAULT_OUTPUT_DIR: &str = "imessage_export";
Expand Down Expand Up @@ -389,12 +390,12 @@ pub fn from_command_line() -> ArgMatches {
#[cfg(test)]
mod arg_tests {
use imessage_database::util::{
dirs::default_db_path, export_type::ExportType, platform::Platform,
query_context::QueryContext,
dirs::default_db_path, platform::Platform, query_context::QueryContext,
};

use crate::app::{
attachment_manager::AttachmentManager,
export_type::ExportType,
options::{get_command, validate_path, Options},
};

Expand Down Expand Up @@ -646,8 +647,11 @@ mod path_tests {
use std::io::Write;
use std::path::PathBuf;

use crate::app::options::{validate_path, DEFAULT_OUTPUT_DIR};
use imessage_database::util::{dirs::home, export_type::ExportType};
use crate::app::{
export_type::ExportType,
options::{validate_path, DEFAULT_OUTPUT_DIR},
};
use imessage_database::util::dirs::home;

#[test]
fn can_validate_empty() {
Expand Down
4 changes: 2 additions & 2 deletions imessage-exporter/src/app/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rusqlite::Connection;
use crate::{
app::{
attachment_manager::AttachmentManager, converter::Converter, error::RuntimeError,
options::Options, sanitizers::sanitize_filename,
export_type::ExportType, options::Options, sanitizers::sanitize_filename,
},
Exporter, HTML, TXT,
};
Expand All @@ -29,7 +29,7 @@ use imessage_database::{
MAX_LENGTH, ME, ORPHANED, UNKNOWN,
},
},
util::{dates::get_offset, export_type::ExportType, size::format_file_size},
util::{dates::get_offset, size::format_file_size},
};

/// Stores the application state and handles application lifecycle
Expand Down

0 comments on commit 4c68927

Please sign in to comment.