mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:24:58 +02:00
Skip strum
in regular nu-protocol
build (#9445)
# Description `derive(EnumIter)` is only required to run completeness tests. Thus make the derive conditional on test and move `strum` and `strum_macros` to the dev dependencies. ## Is it worth it? Removing this derive does not change the binary size (checked via `cargo bloat --crates` from `cargo-bloat`). Compile time change is below a second so hard to judge based on a single run of `cargo clean --profile dev; cargo build --timings` Unsure if this negatively impacts how incremental compilation can recompile when you switch between `cargo build`/`run` and `cargo test` in your local workflow. To get rid of `strum`/`strum_macros` as a proc macro crate we would need to also remove it from `reedline`. Further more a crate in the `polars` dependency tree uses `strum` (curently not as relevant for the 1.0 build).
This commit is contained in:
committed by
GitHub
parent
33535c514e
commit
971f9ae0f0
@ -1,11 +1,13 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[cfg(test)]
|
||||
use strum_macros::EnumIter;
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::SyntaxShape;
|
||||
|
||||
#[derive(Clone, Debug, Default, EnumIter, PartialEq, Eq, Serialize, Deserialize, Hash)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Hash)]
|
||||
#[cfg_attr(test, derive(EnumIter))]
|
||||
pub enum Type {
|
||||
Any,
|
||||
Binary,
|
||||
|
Reference in New Issue
Block a user