Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP
Browse files Browse the repository at this point in the history
al8n committed Sep 17, 2024
1 parent bb3488b commit ff20a52
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/swmr/generic.rs
Original file line number Diff line number Diff line change
@@ -1414,7 +1414,7 @@ where
/// }
///
/// impl<'a> TypeRef<'a> for PersonRef<'a> {
/// fn from_slice(src: &'a [u8]) -> Self {
/// unsafe fn from_slice(src: &'a [u8]) -> Self {
/// let (id_size, id) = decode_u64_varint(src).unwrap();
/// let name = std::str::from_utf8(&src[id_size..]).unwrap();
/// PersonRef { id, name }
9 changes: 1 addition & 8 deletions src/swmr/generic/tests.rs
Original file line number Diff line number Diff line change
@@ -8,13 +8,6 @@ use super::*;

const MB: u32 = 1024 * 1024;

const fn __static_assertion<B: GenericBatch>() {}

const _: () = {
__static_assertion::<std::collections::BTreeMap<String, String>>();
__static_assertion::<std::collections::HashMap<String, String>>();
};

#[cfg(all(test, any(test_swmr_generic_constructor, all_tests)))]
mod constructor;

@@ -168,7 +161,7 @@ impl Type for Person {
}

impl<'a> TypeRef<'a> for PersonRef<'a> {
fn from_slice(src: &'a [u8]) -> Self {
unsafe fn from_slice(src: &'a [u8]) -> Self {
let (id_size, id) = decode_u64_varint(src).unwrap();
let name = std::str::from_utf8(&src[id_size..]).unwrap();
PersonRef { id, name }

0 comments on commit ff20a52

Please sign in to comment.