Skip to content

Commit

Permalink
reexport bytecheck::CheckBytes (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkatychev authored Feb 14, 2023
1 parent 58587fd commit ee14b81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
```rust
use rkyv::{Archive, Deserialize, Serialize};
// bytecheck can be used to validate your data if you want
use bytecheck::CheckBytes;
use rkyv::CheckBytes;

#[derive(Archive, Deserialize, Serialize, Debug, PartialEq)]
// This will generate a PartialEq impl between our unarchived and archived types
Expand Down
3 changes: 1 addition & 2 deletions book_src/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ To validate an archive, you first have to derive
type:

```rs
use bytecheck::CheckBytes;
use rkyv::{Archive, Deserialize, Serialize};
use rkyv::{Archive, CheckBytes, Deserialize, Serialize};

#[derive(Archive, Deserialize, Serialize)]
#[archive_attr(derive(CheckBytes))]
Expand Down
3 changes: 3 additions & 0 deletions rkyv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ pub mod with;
#[cfg(feature = "rend")]
pub use rend;

#[cfg(feature = "validation")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "validation")))]
pub use bytecheck::CheckBytes;
use core::alloc::Layout;
use ptr_meta::Pointee;
pub use rkyv_derive::{Archive, Deserialize, Serialize};
Expand Down
3 changes: 1 addition & 2 deletions rkyv/src/validation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
pub mod owned;
pub mod validators;

use crate::{Archive, ArchivePointee, Fallible, RelPtr};
use bytecheck::CheckBytes;
use crate::{Archive, ArchivePointee, CheckBytes, Fallible, RelPtr};
use core::{alloc::Layout, alloc::LayoutError, any::TypeId, fmt};
use ptr_meta::Pointee;
#[cfg(feature = "std")]
Expand Down

0 comments on commit ee14b81

Please sign in to comment.