diff --git a/Cargo.toml b/Cargo.toml index edbe40a..86472bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,9 +3,9 @@ members = [".", "codegen-exports", "codegen"] [package] name = "include-flate" -version = "0.2.0" +version = "0.3.0" authors = ["SOFe "] -edition = "2018" +edition = "2021" license = "Apache-2.0" repository = "https://github.com/SOF3/include-flate.git" homepage = "https://github.com/SOF3/include-flate" @@ -14,12 +14,12 @@ categories = ["compression", "rust-patterns", "memory-management"] keywords = ["compression", "deflate", "macro", "include", "assets"] [dependencies] -include-flate-codegen-exports = { version = "0.1.4", path = "codegen-exports" } -lazy_static = "1.3" -libflate = "1.0.0" +include-flate-codegen-exports = { version = "0.2.0", path = "codegen-exports" } +lazy_static = "1.3.0" +libflate = "2.0.0" [badges] travis-ci = {repository = "SOF3/include-flate"} [features] -stable = ["include-flate-codegen-exports/stable"] +stable = [] diff --git a/codegen-exports/Cargo.toml b/codegen-exports/Cargo.toml index 6afac48..c739291 100644 --- a/codegen-exports/Cargo.toml +++ b/codegen-exports/Cargo.toml @@ -1,16 +1,12 @@ [package] name = "include-flate-codegen-exports" -version = "0.1.4" +version = "0.2.0" authors = ["SOFe "] -edition = "2018" +edition = "2021" license = "Apache-2.0" repository = "https://github.com/SOF3/include-flate.git" homepage = "https://github.com/SOF3/include-flate" description = "Macro codegen for the include-flate crate" [dependencies] -include-flate-codegen = { version = "0.1.4", path = "../codegen" } -proc-macro-hack = "0.5.9" - -[features] -stable = ["include-flate-codegen/stable"] +include-flate-codegen = { version = "0.2.0", path = "../codegen" } diff --git a/codegen-exports/src/lib.rs b/codegen-exports/src/lib.rs index bbf4314..1118983 100644 --- a/codegen-exports/src/lib.rs +++ b/codegen-exports/src/lib.rs @@ -1,5 +1,2 @@ -#[cfg_attr(feature = "stable", proc_macro_hack::proc_macro_hack)] pub use include_flate_codegen::deflate_file; - -#[cfg_attr(feature = "stable", proc_macro_hack::proc_macro_hack)] pub use include_flate_codegen::deflate_utf8_file; diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index d10a6e4..bb44daa 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "include-flate-codegen" -version = "0.1.4" +version = "0.2.0" authors = ["SOFe "] -edition = "2018" +edition = "2021" license = "Apache-2.0" repository = "https://github.com/SOF3/include-flate.git" homepage = "https://github.com/SOF3/include-flate" @@ -12,11 +12,7 @@ description = "Macro codegen for the include-flate crate" proc-macro = true [dependencies] -libflate = "1.0.0" -proc-macro-hack = { version = "0.5.9", optional = true } +libflate = "2.0.0" proc-macro2 = "1.0.9" quote = "1.0.2" syn = { version = "2.0.2", features = ["full"] } - -[features] -stable = ["proc-macro-hack"] diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index d76a093..81dd0f3 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -13,8 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![cfg_attr(not(feature = "stable"), feature(proc_macro_span))] - extern crate proc_macro; use std::fs::File; @@ -43,8 +41,7 @@ use syn::{Error, LitByteStr, LitStr, Result}; /// # Compile errors /// - If the argument is not a single literal /// - If the referenced file does not exist or is not readable -#[cfg_attr(feature = "stable", proc_macro_hack::proc_macro_hack)] -#[cfg_attr(not(feature = "stable"), proc_macro)] +#[proc_macro] pub fn deflate_file(ts: TokenStream) -> TokenStream { match inner(ts, false) { Ok(ts) => ts.into(), @@ -57,8 +54,7 @@ pub fn deflate_file(ts: TokenStream) -> TokenStream { /// # Compile errors /// - The compile errors in `deflate_file!` /// - If the file contents are not all valid UTF-8 -#[cfg_attr(feature = "stable", proc_macro_hack::proc_macro_hack)] -#[cfg_attr(not(feature = "stable"), proc_macro)] +#[proc_macro] pub fn deflate_utf8_file(ts: TokenStream) -> TokenStream { match inner(ts, true) { Ok(ts) => ts.into(), diff --git a/tests/base64-raw.rs b/tests/base64-raw.rs index 9f44ac3..9974e1e 100644 --- a/tests/base64-raw.rs +++ b/tests/base64-raw.rs @@ -19,5 +19,5 @@ pub static DATA: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/asset #[test] fn test() { - verify_str("base64.txt", &DATA); + verify_str("base64.txt", DATA); } diff --git a/tests/ff-raw.rs b/tests/ff-raw.rs index 690cd6c..1028c33 100644 --- a/tests/ff-raw.rs +++ b/tests/ff-raw.rs @@ -19,5 +19,5 @@ pub static DATA: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/as #[test] fn test() { - verify("ff.dat", &DATA); + verify("ff.dat", DATA); } diff --git a/tests/random-raw.rs b/tests/random-raw.rs index a6794dd..889089b 100644 --- a/tests/random-raw.rs +++ b/tests/random-raw.rs @@ -19,5 +19,5 @@ pub static DATA: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/as #[test] fn test() { - verify("random.dat", &DATA); + verify("random.dat", DATA); } diff --git a/tests/zero-raw.rs b/tests/zero-raw.rs index 6e28afd..9d87e1d 100644 --- a/tests/zero-raw.rs +++ b/tests/zero-raw.rs @@ -19,5 +19,5 @@ pub static DATA: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/as #[test] fn test() { - verify("zero.dat", &DATA); + verify("zero.dat", DATA); }