Skip to content

Commit

Permalink
Merge #35: Do some docs improvements
Browse files Browse the repository at this point in the history
0bc4043 Improve rustdoc about package trick (Tobin C. Harding)
97c41b2 Do minor grammar improvement to rustdoc (Tobin C. Harding)
fb3ae53 Improve crate docs (Tobin C. Harding)

Pull request description:

  Do a few minor improvements, note please that patch one is not just docs it introduces the `rustfmt::skip` trick for public re-exports. Its part of "docs improvements" because it includes adding `doc(inline)`. The other two are trivial.

ACKs for top commit:
  apoelstra:
    ACK 0bc4043
  Kixunil:
    ACK 0bc4043

Tree-SHA512: eef9ccf1d7f3fbec38df04b7ad0e9228c82030f0267e95f53439acbb9d8c181b18279f1cb6088c97714a9c648358ee368ff70fd9d4a49ccf2076c315d75d90e3
  • Loading branch information
apoelstra committed Oct 31, 2023
2 parents 1c198dd + 0bc4043 commit 9c6df3e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/buf_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
//!
//! This is a low-level module, most uses should be satisfied by the `display` module instead.
//!
//! The main type of this module is [`BufEncoder`] which provides buffered hex encoding. Such is
//! faster than the usual `write!(f, "{02x}", b)?` in a for loop because it reduces dynamic
//! dispatch and decreases the number of allocations if a `String` is being created.
//! The main type in this module is [`BufEncoder`] which provides buffered hex encoding.
//! `BufEncoder` is faster than the usual `write!(f, "{02x}", b)?` in a for loop because it reduces
//! dynamic dispatch and decreases the number of allocations if a `String` is being created.
use core::borrow::Borrow;

pub use out_bytes::OutBytes;

use super::Case;

#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
pub use self::out_bytes::OutBytes;

/// Trait for types that can be soundly converted to `OutBytes`.
///
/// To protect the API from future breakage this sealed trait guards which types can be used with
Expand Down
14 changes: 9 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! ## Basic Usage
//! ```
//! # #[cfg(feature = "alloc")] {
//! // Use the `package` key to improve import ergonomics (`hex` instead of `hex-conservative`).
//! // In your manifest use the `package` key to improve import ergonomics.
//! // hex = { package = "hex-conservative", version = "*" }
//! # use hex_conservative as hex; // No need for this if using `package` as above.
//! use hex::{DisplayHex, FromHex};
Expand Down Expand Up @@ -49,16 +49,20 @@ mod error;
mod iter;
pub mod parse;

pub use display::DisplayHex;
pub use iter::{BytesToHexIter, HexToBytesIter};
pub use parse::{FromHex, HexToArrayError, HexToBytesError};

/// Reexports of extension traits.
pub mod exts {
pub use super::display::DisplayHex;
pub use super::parse::FromHex;
}

#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
pub use self::{
display::DisplayHex,
iter::{BytesToHexIter, HexToBytesIter},
parse::{FromHex, HexToArrayError, HexToBytesError},
};

/// Mainly reexports based on features.
pub(crate) mod prelude {
#[cfg(feature = "alloc")]
Expand Down

0 comments on commit 9c6df3e

Please sign in to comment.