From 012e15e1bc87bc6a4f9798745061aa324522c2f1 Mon Sep 17 00:00:00 2001 From: Avril Date: Mon, 23 Aug 2021 19:58:33 +0100 Subject: [PATCH] Reworked project structure for new binary. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-emptively bumped version to `2.0.0`. rematch compiles and links correctly. repatch also links to rematch correctly. Documented manifest: We don"t want LTO to be off, and we don"t want more than 1 codegen unit: The project is now split over multiple crates so cross-crate optimisation is needed or there may be a performance regression in rematch. Fortune for rematch's current commit: Future curse − 末凶 --- Cargo.toml | 3 ++- src/{main.rs => bin/rematch.rs} | 3 +-- src/bin/repatch.rs | 6 ++++++ src/lib.rs | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) rename src/{main.rs => bin/rematch.rs} (97%) create mode 100644 src/bin/repatch.rs create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 6a9ed44..41d23fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "rematch" -version = "0.1.0" +version = "2.0.0" authors = ["Avril "] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [profile.release] +# We have multiple "crates" in this project, so fat LTO and single codegen for better inlining and cross-crate optimisation. opt-level = 3 lto = "fat" codegen-units = 1 diff --git a/src/main.rs b/src/bin/rematch.rs similarity index 97% rename from src/main.rs rename to src/bin/rematch.rs index ec80323..447927d 100644 --- a/src/main.rs +++ b/src/bin/rematch.rs @@ -1,7 +1,6 @@ #![allow(dead_code)] -mod re; -mod text; +use rematch::*; fn main() -> Result<(), Box> { diff --git a/src/bin/repatch.rs b/src/bin/repatch.rs new file mode 100644 index 0000000..95bebe5 --- /dev/null +++ b/src/bin/repatch.rs @@ -0,0 +1,6 @@ +use rematch::*; + +fn main() +{ + println!("Hello world!"); +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..c1465fd --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,5 @@ +#![allow(dead_code)] + +pub mod re; +pub mod text; +