Simplify doctests

This commit is contained in:
Brian Smith 2019-04-11 13:22:55 -10:00
parent bf47ab5767
commit 92578fe258

View File

@ -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);