From 0df8b3adedcb2c9bc1eb9f72996b0df8f7f7ec90 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Sat, 17 Aug 2019 13:19:44 +0000 Subject: [PATCH] Split crate into a workspace --- Cargo.lock | 7 +++++++ Cargo.toml | 5 +++++ cli/Cargo.toml | 8 ++++++++ {src => cli/src}/main.rs | 10 +++------- src/lib.rs | 5 +++++ 5 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 cli/Cargo.toml rename {src => cli/src}/main.rs (92%) create mode 100644 src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8b1d48f..e94fa0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,6 +111,13 @@ dependencies = [ "zip 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fimfareader-cli" +version = "0.1.0" +dependencies = [ + "fimfareader 0.1.0", +] + [[package]] name = "flate2" version = "1.0.11" diff --git a/Cargo.toml b/Cargo.toml index 41ec741..c757bb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,11 @@ version = "0.1.0" authors = ["Joakim Soderlund "] edition = "2018" +[workspace] +members = [ + "cli", +] + [profile.release] lto = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..8ff2f9c --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "fimfareader-cli" +version = "0.1.0" +authors = ["Joakim Soderlund "] +edition = "2018" + +[dependencies.fimfareader] +path = ".." diff --git a/src/main.rs b/cli/src/main.rs similarity index 92% rename from src/main.rs rename to cli/src/main.rs index fbe4b0d..57d624a 100644 --- a/src/main.rs +++ b/cli/src/main.rs @@ -1,18 +1,14 @@ //! Main module. -pub mod archive; -pub mod error; -pub mod query; - use std::env::args; use std::io::stdin; use std::io::stdout; use std::io::Write; use std::time::Instant; -use crate::archive::Fetcher; -use crate::error::Error; -use crate::query::parse; +use fimfareader::archive::Fetcher; +use fimfareader::error::Error; +use fimfareader::query::parse; fn exit(error: Error) -> ! { eprintln!("{}", error); diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..6081311 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,5 @@ +//! Fimfareader. + +pub mod archive; +pub mod error; +pub mod query;