diff --git a/wrapper/rust/wolfssl-wolfcrypt/src/lib.rs b/wrapper/rust/wolfssl-wolfcrypt/src/lib.rs index 2e2b46eb9..dfeef39b7 100644 --- a/wrapper/rust/wolfssl-wolfcrypt/src/lib.rs +++ b/wrapper/rust/wolfssl-wolfcrypt/src/lib.rs @@ -50,6 +50,8 @@ pub mod sha; /// ```rust /// use wolfssl_wolfcrypt::*; /// wolfcrypt_init().expect("Error with wolfcrypt_init()"); +/// // ... use the library ... +/// wolfcrypt_cleanup().expect("wolfCrypt_Cleanup failed"); /// ``` pub fn wolfcrypt_init() -> Result<(), i32> { let rc = unsafe { sys::wolfCrypt_Init() }; @@ -66,12 +68,7 @@ pub fn wolfcrypt_init() -> Result<(), i32> { /// Returns either Ok(()) on success or Err(e) containing the wolfSSL /// library error code value. /// -/// # Example -/// -/// ```rust -/// use wolfssl_wolfcrypt::*; -/// wolfcrypt_cleanup().expect("Error with wolfcrypt_cleanup()"); -/// ``` +/// See also: [`wolfcrypt_init`] pub fn wolfcrypt_cleanup() -> Result<(), i32> { let rc = unsafe { sys::wolfCrypt_Cleanup() }; if rc != 0 { diff --git a/wrapper/rust/wolfssl-wolfcrypt/tests/test_wolfcrypt.rs b/wrapper/rust/wolfssl-wolfcrypt/tests/test_wolfcrypt.rs index 768246fd3..8189e4af8 100644 --- a/wrapper/rust/wolfssl-wolfcrypt/tests/test_wolfcrypt.rs +++ b/wrapper/rust/wolfssl-wolfcrypt/tests/test_wolfcrypt.rs @@ -1,11 +1,7 @@ use wolfssl_wolfcrypt::*; #[test] -fn test_wolfcrypt_init() { +fn test_wolfcrypt_init_and_cleanup() { wolfcrypt_init().expect("Error with wolfcrypt_init()"); -} - -#[test] -fn test_wolfcrypt_cleanup() { wolfcrypt_cleanup().expect("Error with wolfcrypt_cleanup()"); }