Skip to content

Commit

Permalink
feat: split Chain into a struct and ChainKind enum (#5)
Browse files Browse the repository at this point in the history
Instead of checking whether `Self::Id(_)` can be converted into a
`NamedChain` everywhere, we can enforce this at construction by making
`Chain` a struct with a hidden inner `ChainKind` enum.

By making the fields private, we also make room for potential
optimizations in the future, such as reducing the size of `Chain` from
16 to 8 bytes.
  • Loading branch information
DaniPopes authored Nov 14, 2023
1 parent e2a523f commit 4e35dc0
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 134 deletions.
Loading

0 comments on commit 4e35dc0

Please sign in to comment.