From b3dbb30deb32dc88f154d9fc58cde5023ecc7433 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 24 Apr 2022 09:28:41 +0100 Subject: [PATCH] Fix imports for when feature `memfile` is disabled. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for collect's current commit: Blessing − 吉 --- Cargo.toml | 4 ++-- src/main.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1cfb1c8..671a13f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" default = ["jemalloc", "memfile", "logging", "tracing/release_max_level_warn"] # TODO: mmap, memfd_create() ver -memfile = ["bitflags", "lazy_static"] +memfile = ["bitflags", "lazy_static", "stackalloc"] # bytes: use `bytes` crate for collecting instead of `std::vec` @@ -52,5 +52,5 @@ recolored = { version = "1.9.3", optional = true } memchr = "2.4.1" lazy_format = "1.10.0" bitflags = {version = "1.3.2", optional = true } -stackalloc = "1.1.1" +stackalloc = {version = "1.1.1", optional = true } lazy_static = { version = "1.4.0", optional = true } diff --git a/src/main.rs b/src/main.rs index 5857749..022092b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,9 @@ #[cfg(feature="logging")] #[macro_use] extern crate tracing; +#[cfg(feature="memfile")] #[macro_use] extern crate lazy_static; +#[cfg(feature="memfile")] #[macro_use] extern crate stackalloc; /// Run this statement only if `tracing` is enabled