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

chore!: split ValidationError from MaxSizeError; validate and max_serialized_size made BorshSchemaContainer's methods #219

Merged
merged 4 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion borsh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ pub use schema::BorshSchema;
#[cfg(feature = "unstable__schema")]
pub use schema_helpers::{
max_serialized_size, schema_container_of, try_from_slice_with_schema, try_to_vec_with_schema,
MaxSizeError,
};
pub use ser::helpers::{to_vec, to_writer};
pub use ser::BorshSerialize;
Expand Down
4 changes: 4 additions & 0 deletions borsh/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ use core::borrow::Borrow;
use core::cmp::Ord;
use core::marker::PhantomData;

mod container_ext;

pub use container_ext::{SchemaContainerValidateError, SchemaMaxSerializedSizeError};

/// The type that we use to represent the declaration of the Borsh type.
pub type Declaration = String;
/// The type that we use for the name of the variant.
Expand Down
8 changes: 8 additions & 0 deletions borsh/src/schema/container_ext.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use super::{BorshSchemaContainer, Declaration, Definition, Fields};

use max_size::is_zero_size;
pub use max_size::SchemaMaxSerializedSizeError;
pub use validate::SchemaContainerValidateError;

mod max_size;
mod validate;
Loading
Loading