Split crate into a workspace

This commit is contained in:
Joakim Soderlund 2019-08-13 19:28:08 +00:00
parent f0d7380fa6
commit 152e81d4cd
14 changed files with 69 additions and 48 deletions

23
Cargo.lock generated
View file

@ -28,7 +28,7 @@ name = "chrono"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
@ -111,6 +111,13 @@ dependencies = [
"zip 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fimfareader-bin"
version = "0.1.0"
dependencies = [
"fimfareader 0.1.0",
]
[[package]]
name = "hex"
version = "0.3.2"
@ -135,12 +142,12 @@ dependencies = [
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stackvector 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"static_assertions 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
version = "0.2.60"
version = "0.2.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -204,7 +211,7 @@ name = "num_cpus"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -335,7 +342,7 @@ dependencies = [
[[package]]
name = "static_assertions"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -358,7 +365,7 @@ name = "time"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -432,7 +439,7 @@ dependencies = [
"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
"checksum lexical-core 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b0f90c979adde96d19eb10eb6431ba0c441e2f9e9bdff868b2f6f5114ff519"
"checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb"
"checksum libc 0.2.61 (registry+https://github.com/rust-lang/crates.io-index)" = "c665266eb592905e8503ba3403020f4b8794d26263f412ca33171600eca9a6fa"
"checksum libflate 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "45c97cf62125b79dcac52d506acdc4799f21a198597806947fd5f40dc7b93412"
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
@ -458,7 +465,7 @@ dependencies = [
"checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c"
"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
"checksum stackvector 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1c4725650978235083241fab0fdc8e694c3de37821524e7534a1a9061d1068af"
"checksum static_assertions 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4f8de36da215253eb5f24020bfaa0646613b48bf7ebe36cdfa37c3b3b33b241"
"checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"

View file

@ -1,36 +1,8 @@
[package]
name = "fimfareader"
version = "0.1.0"
authors = ["Joakim Soderlund <joakim.soderlund@gmail.com>"]
edition = "2018"
[profile.release]
lto = true
[dependencies.chrono]
version = "*"
features = ["serde"]
[dependencies.chrono-english]
version = "*"
[dependencies.hex]
version = "*"
[dependencies.nom]
version = "5"
[dependencies.rayon]
version = "*"
[dependencies.serde]
version = "*"
features = ["derive"]
[dependencies.serde_json]
version = "*"
[dependencies.zip]
version = "*"
features = ["deflate"]
default-features = false
[workspace]
members = [
"bin",
"lib",
]

8
bin/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "fimfareader-bin"
version = "0.1.0"
authors = ["Joakim Soderlund <joakim.soderlund@gmail.com>"]
edition = "2018"
[dependencies.fimfareader]
path = "../lib"

View file

@ -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);

33
lib/Cargo.toml Normal file
View file

@ -0,0 +1,33 @@
[package]
name = "fimfareader"
version = "0.1.0"
authors = ["Joakim Soderlund <joakim.soderlund@gmail.com>"]
edition = "2018"
[dependencies.chrono]
version = "*"
features = ["serde"]
[dependencies.chrono-english]
version = "*"
[dependencies.hex]
version = "*"
[dependencies.nom]
version = "5"
[dependencies.rayon]
version = "*"
[dependencies.serde]
version = "*"
features = ["derive"]
[dependencies.serde_json]
version = "*"
[dependencies.zip]
version = "*"
features = ["deflate"]
default-features = false

5
lib/src/lib.rs Normal file
View file

@ -0,0 +1,5 @@
//! Library module.
pub mod archive;
pub mod error;
pub mod query;