mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-19 05:44:38 +03: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);
|
/// # assert_eq!(*malloc_box, 42u8);
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
/// # let _ = do_test();
|
||||||
/// ```
|
/// ```
|
||||||
pub fn malloc_box_try<T>(x: T) -> Result<MallocBox<T>, AllocError> {
|
pub fn malloc_box_try<T>(x: T) -> Result<MallocBox<T>, AllocError> {
|
||||||
MallocBox::<T>::try_new_in(x, MallocAllocator::new())
|
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);
|
/// # assert_eq!(*memfdsec_box, 42u8);
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
/// # let _ = do_test();
|
||||||
/// ```
|
/// ```
|
||||||
pub fn memfdsec_box_try<T>(x: T) -> Result<MemfdSecBox<T>, AllocError> {
|
pub fn memfdsec_box_try<T>(x: T) -> Result<MemfdSecBox<T>, AllocError> {
|
||||||
MemfdSecBox::<T>::try_new_in(x, MemfdSecAllocator::new())
|
MemfdSecBox::<T>::try_new_in(x, MemfdSecAllocator::new())
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ static ALLOC_TYPE: OnceLock<SecretAllocType> = OnceLock::new();
|
|||||||
/// }
|
/// }
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
/// # let _ = do_test();
|
||||||
/// ```
|
/// ```
|
||||||
pub fn set_secret_alloc_type(alloc_type: SecretAllocType) {
|
pub fn set_secret_alloc_type(alloc_type: SecretAllocType) {
|
||||||
ALLOC_TYPE.set(alloc_type).unwrap();
|
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);
|
/// # assert_eq!(*secret_box, 42u8);
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
|
/// # let _ = do_test();
|
||||||
/// ```
|
/// ```
|
||||||
pub fn secret_box_try<T>(x: T) -> Result<SecretBox<T>, AllocError> {
|
pub fn secret_box_try<T>(x: T) -> Result<SecretBox<T>, AllocError> {
|
||||||
SecretBox::<T>::try_new_in(x, SecretAlloc::default())
|
SecretBox::<T>::try_new_in(x, SecretAlloc::default())
|
||||||
|
|||||||
Reference in New Issue
Block a user