Skip to content

Commit

Permalink
feat(Rust): Use strum to provide a string representation of enum va…
Browse files Browse the repository at this point in the history
…riants
  • Loading branch information
nokome committed Aug 16, 2021
1 parent 6f631c8 commit 1b7060a
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 70 deletions.
37 changes: 37 additions & 0 deletions rust/Cargo.lock

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

3 changes: 2 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ keywords = ["schema", "executable", "documents"]
chrono = "0.4.19"
defaults = "0.2.0"
enum_dispatch = "0.3.7"
serde = {version = "1.0.127", features = ["derive"] }
serde = { version = "1.0.127", features = ["derive"] }
serde_json = "1.0.66"
serde_with = "1.9.4"
strum = { version = "0.21.0", features = ["derive"] }

[dev-dependencies]
maplit = "1.0.2"
Expand Down
2 changes: 2 additions & 0 deletions rust/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ pub use serde::{de, Deserialize, Deserializer, Serialize};
pub use serde_json::Value;
pub use serde_with::skip_serializing_none;
use std::collections::BTreeMap;
pub use std::convert::AsRef;
pub use std::sync::Arc;
pub use strum::AsRefStr;

/// A trait for methods that can be called on all types of nodes
#[enum_dispatch]
Expand Down
Loading

0 comments on commit 1b7060a

Please sign in to comment.