Skip to content

Commit

Permalink
fix doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Mar 24, 2022
1 parent 6588cfd commit 9784fd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
1 change: 1 addition & 0 deletions actix-hash/src/body_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub struct BodyHashParts<T> {
///
/// # Example
/// ```
/// # extern crate alg_sha2 as sha2;
/// use actix_web::{Responder, web};
/// use actix_web_lab::extract::BodyHash;
/// use sha2::Sha256;
Expand Down
39 changes: 13 additions & 26 deletions actix-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
#![warn(future_incompatible, missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "blake2")]
extern crate alg_blake2 as blake2;
#[cfg(feature = "md4")]
extern crate alg_md4 as md4;
#[cfg(feature = "md5")]
extern crate alg_md5 as md5;
#[cfg(feature = "sha1")]
extern crate alg_sha1 as sha1;
#[cfg(feature = "sha2")]
extern crate alg_sha2 as sha2;
#[cfg(feature = "sha3")]
extern crate alg_sha3 as sha3;

mod body_extractor_fold;
mod body_hash;

Expand Down Expand Up @@ -62,22 +49,22 @@ macro_rules! body_hash_alias {
}

// Obsolete
body_hash_alias!(BodyMd4, md4::Md4, "md4", "MD4", 16);
body_hash_alias!(BodyMd5, md5::Md5, "md5", "MD5", 16);
body_hash_alias!(BodySha1, sha1::Sha1, "sha1", "SHA-1", 20);
body_hash_alias!(BodyMd4, alg_md4::Md4, "md4", "MD4", 16);
body_hash_alias!(BodyMd5, alg_md5::Md5, "md5", "MD5", 16);
body_hash_alias!(BodySha1, alg_sha1::Sha1, "sha1", "SHA-1", 20);

// SHA-2
body_hash_alias!(BodySha224, sha2::Sha224, "sha2", "SHA-224", 28);
body_hash_alias!(BodySha256, sha2::Sha256, "sha2", "SHA-256", 32);
body_hash_alias!(BodySha384, sha2::Sha384, "sha2", "SHA-384", 48);
body_hash_alias!(BodySha512, sha2::Sha512, "sha2", "SHA-512", 64);
body_hash_alias!(BodySha224, alg_sha2::Sha224, "sha2", "SHA-224", 28);
body_hash_alias!(BodySha256, alg_sha2::Sha256, "sha2", "SHA-256", 32);
body_hash_alias!(BodySha384, alg_sha2::Sha384, "sha2", "SHA-384", 48);
body_hash_alias!(BodySha512, alg_sha2::Sha512, "sha2", "SHA-512", 64);

// SHA-3
body_hash_alias!(BodySha3_224, sha3::Sha3_224, "sha3", "SHA-3-224", 28);
body_hash_alias!(BodySha3_256, sha3::Sha3_256, "sha3", "SHA-3-256", 32);
body_hash_alias!(BodySha3_384, sha3::Sha3_384, "sha3", "SHA-3-384", 48);
body_hash_alias!(BodySha3_512, sha3::Sha3_512, "sha3", "SHA-3-512", 64);
body_hash_alias!(BodySha3_224, alg_sha3::Sha3_224, "sha3", "SHA-3-224", 28);
body_hash_alias!(BodySha3_256, alg_sha3::Sha3_256, "sha3", "SHA-3-256", 32);
body_hash_alias!(BodySha3_384, alg_sha3::Sha3_384, "sha3", "SHA-3-384", 48);
body_hash_alias!(BodySha3_512, alg_sha3::Sha3_512, "sha3", "SHA-3-512", 64);

// Blake2
body_hash_alias!(BodyBlake2b, blake2::Blake2b512, "blake2", "Blake2b", 64);
body_hash_alias!(BodyBlake2s, blake2::Blake2s256, "blake2", "Blake2s", 32);
body_hash_alias!(BodyBlake2b, alg_blake2::Blake2b512, "blake2", "Blake2b", 64);
body_hash_alias!(BodyBlake2s, alg_blake2::Blake2s256, "blake2", "Blake2s", 32);

0 comments on commit 9784fd5

Please sign in to comment.