Skip to content

Commit

Permalink
Future-proof external crate support
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Sep 9, 2024
1 parent e309d01 commit 13f74fa
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
external:
- ''
- simdutf8 uuid
- simdutf8 uuid-1

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rust-analyzer.cargo.features": [
"uuid",
"uuid-1",
]
}
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ptr_meta = { version = "=0.3.0-rc.1", default-features = false }
rancor = { version = "=0.1.0-rc.1", default-features = false }
simdutf8 = { version = "0.1", default-features = false }
syn = { version = "2", default-features = false }
uuid = { version = "1", default-features = false }
quote = { version = "1", default-features = false }

[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion bytecheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ simdutf8 = { workspace = true, optional = true }
# time. Before adding support for another crate, please consider getting
# bytecheck support in the crate instead.

uuid = { workspace = true, optional = true }
uuid-1 = { package = "uuid", version = "1", optional = true, default-features = false }

[features]
default = ["simdutf8"]
4 changes: 2 additions & 2 deletions bytecheck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
//! Bytecheck provides integrations for some common crates by default. In the
//! future, crates should depend on bytecheck and provide their own integration.
//!
//! - [`uuid`](https://docs.rs/uuid)
//! - [`uuid-1`](https://docs.rs/uuid/1)
//!
//! ## Example
#![doc = include_str!("../example.md")]
Expand Down Expand Up @@ -68,7 +68,7 @@
// over time. Before adding support for another crate, please consider getting
// bytecheck support in the crate instead.

#[cfg(feature = "uuid")]
#[cfg(feature = "uuid-1")]
mod uuid;

#[cfg(not(feature = "simdutf8"))]
Expand Down
4 changes: 2 additions & 2 deletions bytecheck/src/uuid.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use uuid::Uuid;
use uuid_1::Uuid;

use crate::{rancor::Fallible, CheckBytes};

Expand All @@ -13,7 +13,7 @@ unsafe impl<C: Fallible + ?Sized> CheckBytes<C> for Uuid {

#[cfg(test)]
mod tests {
use uuid::Uuid;
use uuid_1::Uuid;

use crate::{check_bytes, rancor::Infallible};

Expand Down

0 comments on commit 13f74fa

Please sign in to comment.