Skip to content

docs: hide boilerplate from documentation examples#261

Open
jayendra13 wants to merge 1 commit intorust-vmm:mainfrom
jayendra13:hide-doc-boilerplate
Open

docs: hide boilerplate from documentation examples#261
jayendra13 wants to merge 1 commit intorust-vmm:mainfrom
jayendra13:hide-doc-boilerplate

Conversation

@jayendra13
Copy link

Use Rust's doc-test hiding feature (# prefix) to hide extern crate and use statements from rendered documentation while keeping them for compilation. This reduces visual clutter in the docs and lets users focus on the actual usage code.

Files updated:

  • src/errno.rs
  • src/tempfile.rs
  • src/align.rs
  • src/unix/event.rs
  • src/linux/epoll.rs
  • src/linux/eventfd.rs
  • src/linux/timerfd.rs
  • src/linux/signal.rs
  • src/linux/ioctl.rs
  • src/unix/terminal.rs
  • src/fam.rs

Fixes: #81

Summary of the PR

Please summarize here why the changes in this PR are needed.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Use Rust's doc-test hiding feature (# prefix) to hide extern crate
and use statements from rendered documentation while keeping them
for compilation. This reduces visual clutter in the docs and lets
users focus on the actual usage code.

Files updated:
- src/errno.rs
- src/tempfile.rs
- src/align.rs
- src/unix/event.rs
- src/linux/epoll.rs
- src/linux/eventfd.rs
- src/linux/timerfd.rs
- src/linux/signal.rs
- src/linux/ioctl.rs
- src/unix/terminal.rs
- src/fam.rs

Fixes: rust-vmm#81
Signed-off-by: jayendra13 <jayendra0parmar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide "extern crate" and "use" statements from generated documentation examples

1 participant