Skip to content

Commit

Permalink
Switch order
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Apr 30, 2021
1 parent 27348a6 commit ab55989
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/engine-jit/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ impl SerializableModule {
///
/// # Safety
///
/// This method is unsafe.
/// Please check `SerializableModule::archive_from_slice` for more details.
/// This method is unsafe since it deserializes data directly
/// from memory.
/// Right now we are not doing any extra work for validation, but
/// `rkyv` has an option to do bytecheck on the serialized data before
/// serializing (via `rkyv::check_archived_value`).
pub unsafe fn deserialize(metadata_slice: &[u8]) -> Result<Self, DeserializeError> {
let archived = Self::archive_from_slice(metadata_slice)?;
Self::deserialize_from_archive(archived)
}

/// # Safety
///
/// This method is unsafe since it deserializes data directly
/// from memory.
/// Right now we are not doing any extra work for validation, but
/// `rkyv` has an option to do bytecheck on the serialized data before
/// serializing (via `rkyv::check_archived_value`).
/// This method is unsafe.
/// Please check `SerializableModule::deserialize` for more details.
unsafe fn archive_from_slice<'a>(
metadata_slice: &'a [u8],
) -> Result<&'a ArchivedSerializableModule, DeserializeError> {
Expand Down

0 comments on commit ab55989

Please sign in to comment.