8000 doc: Comparison to Ecosystem (including Rust std impl) [doc: 4/N] by phip1611 · Pull Request #1292 · rust-osdev/uefi-rs · GitHub
[go: up one dir, main page]

Skip to content

doc: Comparison to Ecosystem (including Rust std impl) [doc: 4/N] #1292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: add minimal example to lib.rs
  • Loading branch information
phip1611 committed Aug 15, 2024
commit f094ccf4c5aae5009278344b719ff7dc7dce6b59
11 changes: 11 additions & 0 deletions uefi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
//! important UEFI concepts. For more details of UEFI, see the latest [UEFI
//! Specification][spec].
//!
//! # Minimal Example
//!
//! Minimal example for an UEFI application using functionality of the
//! `uefi` crate:
//!
//! ```ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With ignore there's a good chance the code will stop compiling over time (in fact currently it's missing a use uefi::println). It's tricky to get no_std code compiling in a doc test, so how about linking to a file that is already tested by CI? Example:

//! ```ignore
#![doc = include_str!("../../template/src/main.rs")]
//! ```

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, great idea! Thanks

#![doc = include_str!("../../template/src/main.rs")]
//! ```
//!
//! Please find more info in our [Rust UEFI Book].
//!
//! # Value-add and Use Cases
//!
//! `uefi` supports writing code for both pre- and post-exit boot services
Expand Down
Loading
0