Skip to content

Commit 36c27d9

Browse files
committed
multiboot2: doc: fixes
1 parent 8f83bf3 commit 36c27d9

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ insert_final_newline = true
99
indent_style = space
1010
indent_size = 4
1111
trim_trailing_whitespace = true
12+
max_line_length = 80
1213

1314
[*.yml]
1415
indent_size = 2

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[workspace]
22
members = [
3-
# Multiboot2 Information Structure (MBI)
43
"multiboot2",
5-
# Multiboot2 headers
64
"multiboot2-header",
75
]

multiboot2/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG for crate `multiboot2`
22

3+
## 0.14.2
4+
- documentation fixes
5+
36
## 0.14.1 (2023-03-09)
47
- fixed the calculation of the last area of the memory map tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119))
58
(Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag)

multiboot2/src/boot_loader_name.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ impl BootLoaderNameTag {
2121
///
2222
/// # Examples
2323
///
24-
/// ```ignore
24+
/// ```rust,no_run
25+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
2526
/// if let Some(tag) = boot_info.boot_loader_name_tag() {
26-
/// let name = tag.name();
27-
/// assert_eq!("GRUB 2.02~beta3-5", name);
27+
/// assert_eq!(Ok("GRUB 2.02~beta3-5"), tag.name());
2828
/// }
2929
/// ```
3030
pub fn name(&self) -> Result<&str, Utf8Error> {

multiboot2/src/command_line.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ impl CommandLineTag {
2525
///
2626
/// # Examples
2727
///
28-
/// ```ignore
28+
/// ```rust,no_run
29+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
2930
/// if let Some(tag) = boot_info.command_line_tag() {
3031
/// let command_line = tag.command_line();
31-
/// assert_eq!("/bootarg", command_line);
32+
/// assert_eq!(Ok("/bootarg"), command_line);
3233
/// }
3334
/// ```
3435
pub fn command_line(&self) -> Result<&str, str::Utf8Error> {

multiboot2/src/elf_sections.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ impl ElfSectionsTag {
3333
///
3434
/// # Examples
3535
///
36-
/// ```ignore
36+
/// ```rust,no_run
37+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
3738
/// if let Some(elf_tag) = boot_info.elf_sections_tag() {
3839
/// let mut total = 0;
3940
/// for section in elf_tag.sections() {

multiboot2/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
// https://github.com/rust-osdev/multiboot2/pull/92
77
#![deny(clippy::all)]
88
#![deny(rustdoc::all)]
9-
// Forcing this would be a little bit ridiculous, because it would require code examples for
10-
// each getter and each trivial trait implementation (like Debug).
9+
#![allow(rustdoc::private_doc_tests)]
1110
#![allow(rustdoc::missing_doc_code_examples)]
1211
// --- END STYLE CHECKS ---
1312

@@ -88,7 +87,7 @@ pub const MULTIBOOT2_BOOTLOADER_MAGIC: u32 = 0x36d76289;
8887

8988
/// Load the multiboot boot information struct from an address.
9089
///
91-
/// This is the same as `load_with_offset` but the offset is omitted and set
90+
/// This is the same as [`load_with_offset`] but the offset is omitted and set
9291
/// to zero.
9392
///
9493
/// ## Example
@@ -117,7 +116,7 @@ pub unsafe fn load(address: usize) -> Result<BootInformation, MbiLoadError> {
117116
///
118117
/// ## Example
119118
///
120-
/// ```ignore
119+
/// ```rust,no_run
121120
/// use multiboot2::load_with_offset;
122121
///
123122
/// let ptr = 0xDEADBEEF as *const u32;
@@ -197,8 +196,9 @@ impl BootInformation {
197196
///
198197
/// This is the same as doing:
199198
///
200-
/// ```ignore
201-
/// let end_addr = boot_info.start_address() + boot_info.size();
199+
/// ```rust,no_run
200+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
201+
/// let end_addr = boot_info.start_address() + boot_info.total_size();
202202
/// ```
203203
pub fn end_address(&self) -> usize {
204204
self.start_address() + self.total_size()

0 commit comments

Comments
 (0)