Skip to content

Commit

Permalink
Merge pull request #1371 from jqnatividad/apply-perfect-hash-function…
Browse files Browse the repository at this point in the history
…s-operations

`apply` & `applydp`: use perfect hash functions for operations lookups
  • Loading branch information
jqnatividad authored Oct 18, 2023
2 parents 6912b18 + 01a459a commit 539ef79
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 11 deletions.
61 changes: 53 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ simple-home-dir = { version = "0.2", features = [
smartstring = { version = "1", optional = true }
snap = "1"
strsim = { version = "0.10", optional = true }
strum = "0.25"
strum = { version = "0.25", features = ["phf"] }
strum_macros = "0.25"
sysinfo = "0.29"
tabwriter = "1.3"
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ use crate::{
util, CliResult,
};

#[derive(EnumString)]
#[derive(Clone, EnumString)]
#[strum(use_phf)]
#[strum(ascii_case_insensitive)]
#[allow(non_camel_case_types)]
enum Operations {
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/applydp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ use crate::{
util, CliResult,
};

#[derive(EnumString)]
#[derive(Clone, EnumString)]
#[strum(use_phf)]
#[strum(ascii_case_insensitive)]
#[allow(non_camel_case_types)]
enum Operations {
Expand Down

0 comments on commit 539ef79

Please sign in to comment.