Simplify doctests
This commit is contained in:
parent
bf47ab5767
commit
92578fe258
@ -183,18 +183,14 @@ impl Context {
|
||||
///
|
||||
/// ```
|
||||
/// # #[cfg(feature = "use_heap")]
|
||||
/// # fn main() {
|
||||
/// # {
|
||||
/// use ring::{digest, test};
|
||||
///
|
||||
/// let expected_hex = "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b";
|
||||
/// let expected: Vec<u8> = test::from_hex(expected_hex).unwrap();
|
||||
/// let actual = digest::digest(&digest::SHA256, b"hello, world");
|
||||
///
|
||||
/// assert_eq!(&expected, &actual.as_ref());
|
||||
/// # }
|
||||
///
|
||||
/// # #[cfg(not(feature = "use_heap"))]
|
||||
/// # fn main() { }
|
||||
/// ```
|
||||
pub fn digest(algorithm: &'static Algorithm, data: &[u8]) -> Digest {
|
||||
let mut ctx = Context::new(algorithm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user