Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move export type module #216

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading