File tree Expand file tree Collapse file tree
wrapper/rust/wolfssl-wolfcrypt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ pub mod sha;
5050/// ```rust
5151/// use wolfssl_wolfcrypt::*;
5252/// wolfcrypt_init().expect("Error with wolfcrypt_init()");
53+ /// // ... use the library ...
54+ /// wolfcrypt_cleanup().expect("wolfCrypt_Cleanup failed");
5355/// ```
5456pub fn wolfcrypt_init ( ) -> Result < ( ) , i32 > {
5557 let rc = unsafe { sys:: wolfCrypt_Init ( ) } ;
@@ -66,12 +68,7 @@ pub fn wolfcrypt_init() -> Result<(), i32> {
6668/// Returns either Ok(()) on success or Err(e) containing the wolfSSL
6769/// library error code value.
6870///
69- /// # Example
70- ///
71- /// ```rust
72- /// use wolfssl_wolfcrypt::*;
73- /// wolfcrypt_cleanup().expect("Error with wolfcrypt_cleanup()");
74- /// ```
71+ /// See also: [`wolfcrypt_init`]
7572pub fn wolfcrypt_cleanup ( ) -> Result < ( ) , i32 > {
7673 let rc = unsafe { sys:: wolfCrypt_Cleanup ( ) } ;
7774 if rc != 0 {
Original file line number Diff line number Diff line change 11use wolfssl_wolfcrypt:: * ;
22
33#[ test]
4- fn test_wolfcrypt_init ( ) {
4+ fn test_wolfcrypt_init_and_cleanup ( ) {
55 wolfcrypt_init ( ) . expect ( "Error with wolfcrypt_init()" ) ;
6- }
7-
8- #[ test]
9- fn test_wolfcrypt_cleanup ( ) {
106 wolfcrypt_cleanup ( ) . expect ( "Error with wolfcrypt_cleanup()" ) ;
117}
You can’t perform that action at this time.
0 commit comments