diff --git a/Cargo.lock b/Cargo.lock index ce75abe..b696a93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -424,7 +424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "journal_types" +name = "journal" version = "0.1.0" dependencies = [ "chrono", @@ -582,7 +582,7 @@ dependencies = [ "chrono", "chrono-tz", "clap", - "journal_types", + "journal", "log", "prettytable-rs", "serde", diff --git a/Cargo.toml b/Cargo.toml index 0457bcd..6bddf08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -journal_types = { path = "./journal_types" } +journal = { path = "./journal" } chrono = { version = "0.4.38", features = ["serde"] } chrono-tz = { version = "0.10.0", features = ["serde"] } clap = { version = "4.5.21", features = ["derive"] } diff --git a/journal_types/Cargo.toml b/journal/Cargo.toml similarity index 91% rename from journal_types/Cargo.toml rename to journal/Cargo.toml index 6065ea1..7f5dd87 100644 --- a/journal_types/Cargo.toml +++ b/journal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "journal_types" +name = "journal" version = "0.1.0" edition = "2021" diff --git a/journal/src/lib.rs b/journal/src/lib.rs new file mode 100644 index 0000000..dd198c6 --- /dev/null +++ b/journal/src/lib.rs @@ -0,0 +1 @@ +pub mod types; \ No newline at end of file diff --git a/journal/src/types/mod.rs b/journal/src/types/mod.rs new file mode 100644 index 0000000..36d23a0 --- /dev/null +++ b/journal/src/types/mod.rs @@ -0,0 +1,9 @@ +mod types; + +pub use { + types::AdministrationRoute, + types::Ingestion, + types::CustomSubstance, + types::Experience, + types::ExportData +}; diff --git a/journal_types/src/lib.rs b/journal/src/types/types.rs similarity index 99% rename from journal_types/src/lib.rs rename to journal/src/types/types.rs index b636769..99be4f4 100644 --- a/journal_types/src/lib.rs +++ b/journal/src/types/types.rs @@ -71,4 +71,4 @@ pub struct ExportData { //pub custom_substances: Vec, //pub custom_units: Vec, pub experiences: Vec, -} +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 9bd2d51..4a2f370 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ use std::fs::File; use std::env; -use journal_types; +use journal; use serde_json; fn main() -> Result<(), Box> { let args: Vec = env::args().collect(); let file = File::open(args[1].clone())?; - let mut export_data: journal_types::ExportData = + let mut export_data: journal::types::ExportData = serde_json::from_reader(file)?; export_data.experiences.sort_by(|a, b| a.modified_time.cmp(&b.modified_time)); for experience in export_data.experiences.iter_mut() {