Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bitcode support #739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -2,7 +2,7 @@ name: Continuous integration

env:
VERSION_FEATURES: "v1 v3 v4 v5 v6 v7 v8"
DEP_FEATURES: "slog serde arbitrary borsh zerocopy bytemuck"
DEP_FEATURES: "slog serde arbitrary borsh zerocopy bytemuck bitcode"

on:
pull_request:
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Expand Up @@ -99,6 +99,11 @@ version = "2"
optional = true
version = "1.1.3"

# Public: Used in trait impls on `Uuid`
[dependencies.bitcode]
version = "0.5.1"
optional = true

# Public (unstable): Used in `zerocopy` derive
# Unstable: also need RUSTFLAGS="--cfg uuid_unstable" to work
# This feature may break between releases, or be removed entirely before
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Expand Up @@ -114,6 +114,7 @@
//! This feature requires more dependencies to compile, but is just as suitable for
//! UUIDs as the default algorithm.
//! * `bytemuck` - adds a `Pod` trait implementation to `Uuid` for byte manipulation
//! * `bitcode` - adds the ability to encode and decode a UUID using `bitcode`.
//!
//! # Unstable features
//!
Expand Down Expand Up @@ -439,6 +440,7 @@ pub enum Variant {
all(uuid_unstable, feature = "zerocopy"),
derive(AsBytes, FromBytes, Unaligned)
)]
#[cfg_attr(feature = "bitcode", derive(bitcode::Encode, bitcode::Decode))]
#[cfg_attr(
feature = "borsh",
derive(borsh_derive::BorshDeserialize, borsh_derive::BorshSerialize)
Expand Down