Skip to content

Commit

Permalink
Merge pull request RustCrypto#166 from RustCrypto/doc-improvements
Browse files Browse the repository at this point in the history
block-cipher/crypto-mac: add doc_cfg + comments
  • Loading branch information
tarcieri committed Jun 3, 2020
2 parents c226638 + cebfee5 commit 2b87aba
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion block-cipher/Cargo.toml
Expand Up @@ -20,4 +20,5 @@ std = []
dev = ["blobby"]

[package.metadata.docs.rs]
features = [ "std" ]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
2 changes: 2 additions & 0 deletions block-cipher/src/dev.rs
Expand Up @@ -4,6 +4,7 @@ pub use blobby;

/// Define test
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
macro_rules! new_test {
($name:ident, $test_name:expr, $cipher:ty) => {
#[test]
Expand Down Expand Up @@ -109,6 +110,7 @@ macro_rules! new_test {

/// Define benchmark
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
macro_rules! bench {
($cipher:path, $key_len:expr) => {
extern crate test;
Expand Down
13 changes: 12 additions & 1 deletion block-cipher/src/lib.rs
@@ -1,7 +1,17 @@
//! This crate defines a set of simple traits used to define functionality of
//! block ciphers.
//! [block ciphers][1].
//!
//! # About block ciphers
//!
//! Block ciphers are keyed, deterministic permutations of a fixed-sized input
//! "block" providing a reversible transformation to/from an encrypted output.
//! They are one of the fundamental structural components of [symmetric cryptography][2].
//!
//! [1]: https://en.wikipedia.org/wiki/Block_cipher
//! [2]: https://en.wikipedia.org/wiki/Symmetric-key_algorithm

#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
Expand All @@ -10,6 +20,7 @@
extern crate std;

#[cfg(feature = "dev")]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
pub mod dev;

mod errors;
Expand Down
3 changes: 2 additions & 1 deletion crypto-mac/Cargo.toml
Expand Up @@ -21,4 +21,5 @@ dev = ["blobby"]
std = []

[package.metadata.docs.rs]
features = [ "std" ]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
2 changes: 2 additions & 0 deletions crypto-mac/src/dev.rs
Expand Up @@ -4,6 +4,7 @@ pub use blobby;

/// Define test
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
macro_rules! new_test {
($name:ident, $test_name:expr, $mac:ty) => {
#[test]
Expand Down Expand Up @@ -58,6 +59,7 @@ macro_rules! new_test {

/// Define benchmark
#[macro_export]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
macro_rules! bench {
($name:ident, $engine:path, $bs:expr) => {
#[bench]
Expand Down
2 changes: 2 additions & 0 deletions crypto-mac/src/lib.rs
@@ -1,6 +1,7 @@
//! This crate provides trait for Message Authentication Code (MAC) algorithms.

#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
Expand All @@ -9,6 +10,7 @@
extern crate std;

#[cfg(feature = "dev")]
#[cfg_attr(docsrs, doc(cfg(feature = "dev")))]
pub mod dev;

mod errors;
Expand Down

0 comments on commit 2b87aba

Please sign in to comment.