mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-05 20:40:02 -08:00
test(fix-doctest): fix doctests where a function si wrapped around a doctest but the function is never called
This commit is contained in:
@@ -39,6 +39,7 @@ pub type MallocVec<T> = allocator_api2::vec::Vec<T, MallocAllocator>;
|
||||
/// # assert_eq!(*malloc_box, 42u8);
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// # let _ = do_test();
|
||||
/// ```
|
||||
pub fn malloc_box_try<T>(x: T) -> Result<MallocBox<T>, AllocError> {
|
||||
MallocBox::<T>::try_new_in(x, MallocAllocator::new())
|
||||
|
||||
@@ -40,6 +40,7 @@ pub type MemfdSecVec<T> = allocator_api2::vec::Vec<T, MemfdSecAllocator>;
|
||||
/// # assert_eq!(*memfdsec_box, 42u8);
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// # let _ = do_test();
|
||||
/// ```
|
||||
pub fn memfdsec_box_try<T>(x: T) -> Result<MemfdSecBox<T>, AllocError> {
|
||||
MemfdSecBox::<T>::try_new_in(x, MemfdSecAllocator::new())
|
||||
|
||||
@@ -38,6 +38,7 @@ static ALLOC_TYPE: OnceLock<SecretAllocType> = OnceLock::new();
|
||||
/// }
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// # let _ = do_test();
|
||||
/// ```
|
||||
pub fn set_secret_alloc_type(alloc_type: SecretAllocType) {
|
||||
ALLOC_TYPE.set(alloc_type).unwrap();
|
||||
@@ -135,6 +136,7 @@ pub type SecretVec<T> = allocator_api2::vec::Vec<T, SecretAlloc>;
|
||||
/// # assert_eq!(*secret_box, 42u8);
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// # let _ = do_test();
|
||||
/// ```
|
||||
pub fn secret_box_try<T>(x: T) -> Result<SecretBox<T>, AllocError> {
|
||||
SecretBox::<T>::try_new_in(x, SecretAlloc::default())
|
||||
|
||||
Reference in New Issue
Block a user