diff --git a/.gitignore b/.gitignore index cf0573b..96ef6c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ /target -/impl/target -**/*.rs.bk Cargo.lock -*~ diff --git a/Cargo.toml b/Cargo.toml index 4056e54..4263085 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,18 @@ -[package] -name = "tailcall" +[workspace] + +members = [ + "tailcall", + "tailcall-impl", +] + +[workspace.package] description = "Safe, zero-cost tail recursion" documentation = "https://docs.rs/tailcall" repository = "https://github.com/alecdotninja/tailcall" readme = "README.md" keywords = ["recursion", "tail", "tailcall", "become"] categories = ["algorithms", "no-std"] -exclude = ["/.github", ".gitignore"] license = "MIT OR Apache-2.0" authors = ["Alec Larsen "] version = "1.0.0" -edition = "2018" - -[badges] -travis-ci = { repository = "alecdotninja/tailcall" } - -[dependencies] -tailcall-impl = { path = "impl", version = "1.0.0" } - -[dev-dependencies] -backtrace = "0.3.40" -bencher = "0.1.5" - -[[bench]] -name = "bench" -harness = false +edition = "2018" \ No newline at end of file diff --git a/README.md b/README.md index 205a46e..9a1c6a9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -tailcall = "1.0.0" +tailcall = "~1" ``` ## Usage diff --git a/impl/Cargo.toml b/impl/Cargo.toml deleted file mode 100644 index d3e6687..0000000 --- a/impl/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "tailcall-impl" -description = "The procedural macro implementation for the tailcall crate" -documentation = "https://docs.rs/tailcall" -repository = "https://github.com/alecdotninja/tailcall" -keywords = ["recursion", "tail", "tailcall", "become"] -categories = ["algorithms", "no-std"] -license = "MIT OR Apache-2.0" -authors = ["Alec Larsen "] -version = "1.0.0" -edition = "2018" - -[badges] -travis-ci = { repository = "alecdotninja/tailcall" } - -[dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = { version = "1.0", features = ["full", "fold"] } - -[lib] -proc-macro = true diff --git a/tailcall-impl/Cargo.toml b/tailcall-impl/Cargo.toml new file mode 100644 index 0000000..6b7ccd7 --- /dev/null +++ b/tailcall-impl/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "tailcall-impl" +description = "The procedural macro implementation for the tailcall crate" +documentation.workspace = true +repository.workspace = true +readme.workspace = true +keywords.workspace = true +categories.workspace = true +license.workspace = true +authors.workspace = true +version.workspace = true +edition.workspace = true + +[dependencies] +proc-macro2 = "~1" +quote = "~1" +syn = { version = "~1", features = ["full", "fold"] } + +[lib] +proc-macro = true diff --git a/impl/src/helpers.rs b/tailcall-impl/src/helpers.rs similarity index 100% rename from impl/src/helpers.rs rename to tailcall-impl/src/helpers.rs diff --git a/impl/src/lib.rs b/tailcall-impl/src/lib.rs similarity index 97% rename from impl/src/lib.rs rename to tailcall-impl/src/lib.rs index 1e80b08..fdcc728 100644 --- a/impl/src/lib.rs +++ b/tailcall-impl/src/lib.rs @@ -31,7 +31,7 @@ use syn::{parse_macro_input, ItemFn}; /// # Example /// /// ``` -/// use tailcall::tailcall; +/// use tailcall_impl::tailcall; /// /// fn factorial(input: u64) -> u64 { /// #[tailcall] @@ -52,7 +52,7 @@ use syn::{parse_macro_input, ItemFn}; /// - All recursive calls must be in [tail form]: /// /// ```compile_fail -/// use tailcall::tailcall; +/// use tailcall_impl::tailcall; /// /// #[tailcall] /// fn factorial(input: u64) -> u64 { diff --git a/impl/src/transforms.rs b/tailcall-impl/src/transforms.rs similarity index 100% rename from impl/src/transforms.rs rename to tailcall-impl/src/transforms.rs diff --git a/tailcall/Cargo.toml b/tailcall/Cargo.toml new file mode 100644 index 0000000..b2e08ff --- /dev/null +++ b/tailcall/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tailcall" +description.workspace = true +documentation.workspace = true +repository.workspace = true +readme.workspace = true +keywords.workspace = true +categories.workspace = true +license.workspace = true +authors.workspace = true +version.workspace = true +edition.workspace = true + +[dependencies] +tailcall-impl = { path = "../tailcall-impl" } + +[dev-dependencies] +backtrace = "~0.3" +bencher = "~0.1" + +[[bench]] +name = "bench" +harness = false diff --git a/benches/bench.rs b/tailcall/benches/bench.rs similarity index 100% rename from benches/bench.rs rename to tailcall/benches/bench.rs diff --git a/src/lib.rs b/tailcall/src/lib.rs similarity index 100% rename from src/lib.rs rename to tailcall/src/lib.rs diff --git a/src/trampoline.rs b/tailcall/src/trampoline.rs similarity index 100% rename from src/trampoline.rs rename to tailcall/src/trampoline.rs diff --git a/tests/correctness.rs b/tailcall/tests/correctness.rs similarity index 100% rename from tests/correctness.rs rename to tailcall/tests/correctness.rs diff --git a/tests/correctness_option.rs b/tailcall/tests/correctness_option.rs similarity index 100% rename from tests/correctness_option.rs rename to tailcall/tests/correctness_option.rs diff --git a/tests/correctness_result.rs b/tailcall/tests/correctness_result.rs similarity index 100% rename from tests/correctness_result.rs rename to tailcall/tests/correctness_result.rs diff --git a/tests/stack_depth.rs b/tailcall/tests/stack_depth.rs similarity index 100% rename from tests/stack_depth.rs rename to tailcall/tests/stack_depth.rs