rust-bitcoin / rust-bech32

Bech32 format encoding and decoding
MIT License
94 stars 49 forks source link

Improve public re-exports #137

Closed tcharding closed 1 year ago

tcharding commented 1 year ago

Improve the public exports in two ways:

  1. Inline re-exports into the docs of the module that re-exports them.
  2. Separate public and private use statements

Recently we discussed a way to separate the public and private import statements to make the code more clear and prevent rustfmt joining them all together.

Separate public exports using a code block and #[rustfmt::skip]. Has the nice advantage of reducing the number of #[doc(inline)] attributes also.

  1. Modules first, as they are part of the project's structure.
  2. Private imports
  3. Public re-exports (using rustfmt::skip to prevent merge)

Use the format

mod xyz;
mod abc;

use ...;

pub use {
    ...,
};

This patch introduces changes to the rendered HTML docs.

tcharding commented 1 year ago

Based on discussion here: https://github.com/rust-bitcoin/rust-bitcoin/discussions/2088