From 458c5dc75dc4251339b757d7e6271e9003859f71 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Fri, 12 Feb 2021 01:23:41 +0900 Subject: [PATCH] Make it also available as library --- Cargo.toml | 4 ---- src/{main.rs => bin/zifu.rs} | 9 ++++----- src/lib.rs | 5 +++++ 3 files changed, 9 insertions(+), 9 deletions(-) rename src/{main.rs => bin/zifu.rs} (99%) create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 81e4f42..4847a88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,6 @@ description = "Repair corrupted file names in ZIP archives" categories = ["command-line-utilities"] keywords = ["zip", "archive", "utf-8", "encoding"] -[[bin]] -name = "zifu" -path = "src/main.rs" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/main.rs b/src/bin/zifu.rs similarity index 99% rename from src/main.rs rename to src/bin/zifu.rs index f41fc96..16a0473 100644 --- a/src/main.rs +++ b/src/bin/zifu.rs @@ -1,8 +1,7 @@ -mod filename_decoder; -mod zip_central_directory; -mod zip_eocd; -mod zip_error; -mod zip_local_file_header; +use zifu::filename_decoder; +use zifu::zip_central_directory; +use zifu::zip_eocd; +use zifu::zip_local_file_header; use ansi_term::Color::{Green, Red, Yellow}; use anyhow::anyhow; use byteorder::{ReadBytesExt, WriteBytesExt}; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..648d3a5 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,5 @@ +pub mod filename_decoder; +pub mod zip_central_directory; +pub mod zip_eocd; +pub mod zip_error; +pub mod zip_local_file_header; \ No newline at end of file