Skip to content

Commit d08e5eb

Browse files
committed
clippy: apply new fixes
1 parent aefff50 commit d08e5eb

File tree

4 files changed

+100
-41
lines changed

4 files changed

+100
-41
lines changed

multiboot2-header/Changelog.md

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

3+
## Unreleased
4+
5+
- added `EndHeaderTag::default()`
6+
37
## 0.3.2 (2023-11-30)
48

59
- **BREAKING** bumped `multiboot2` dependency to `v0.19.0`
@@ -22,20 +26,23 @@
2226
- **BREAKING** `HeaderBuilder::build` now returns a value of type `HeaderBytes`
2327
The old builder could produce misaligned structures.
2428
- added the optional `unstable` feature (requires nightly)
25-
- implement `core::error::Error` for `LoadError`
29+
- implement `core::error::Error` for `LoadError`
2630

2731
## 0.2.0 (2022-05-03)
2832

2933
- **BREAKING** renamed `EntryHeaderTag` to `EntryAddressHeaderTag`
30-
- **BREAKING** some paths changed from `multiboot2_header::header` to `multiboot2_header::builder`
31-
-> thus, import paths are much more logically now
34+
- **BREAKING** some paths changed from `multiboot2_header::header`
35+
to `multiboot2_header::builder`
36+
-> thus, import paths are much more logically now
3237
- internal code improvements
3338

3439
## 0.1.1 (2022-05-02)
3540

3641
- fixed a bug that prevented the usage of the crate in `no_std` environments
37-
- added a new default `builder`-feature to Cargo which requires the `alloc`-crate
38-
(this feature can be disabled which will also remove the dependency to the `alloc` crate)
42+
- added a new default `builder`-feature to Cargo which requires the `alloc`
43+
-crate
44+
(this feature can be disabled which will also remove the dependency to
45+
the `alloc` crate)
3946

4047
## 0.1.0 (2021-10-08)
4148

multiboot2-header/src/end.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ pub struct EndHeaderTag {
1212
size: u32,
1313
}
1414

15+
impl Default for EndHeaderTag {
16+
fn default() -> Self {
17+
Self::new()
18+
}
19+
}
20+
1521
impl EndHeaderTag {
1622
pub const fn new() -> Self {
1723
EndHeaderTag {

multiboot2/Changelog.md

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# CHANGELOG for crate `multiboot2`
22

3+
## Unreleased
4+
5+
- added `InformationBuilder::default()`
6+
37
## 0.19.0 (2023-09-21)
8+
49
- **BREAKING** MSRV is 1.69.0
510
- **BREAKING** `Tag::get_dst_str_slice` renamed to
611
`Tag::parse_slice_as_string` and now returns `Result<&str, StringError>`
@@ -14,9 +19,11 @@
1419
`add_tag` was introduced for that.
1520

1621
## 0.18.1 (2023-07-13)
22+
1723
- Documentation improvements
1824

1925
## 0.18.0 (2023-07-13)
26+
2027
- **BREAKING** The `TagTrait` was enhanced and now has an associated `ID`
2128
constant. This is only breaking to users that used `BootInformation::get_tag`
2229
or that implement custom tags. `BootInformation::get_tag` doesn't need the
@@ -37,29 +44,39 @@
3744
- Internal code cleanup.
3845

3946
## 0.17.0 (2023-07-12)
40-
- **BREAKING** Make functions of `InformationBuilder` chainable. They now consume the builder.
47+
48+
- **BREAKING** Make functions of `InformationBuilder` chainable. They now
49+
consume the builder.
4150
- **BREAKING** Allow non-standard memory area types by using new pair of
4251
corresponding types: `MemoryAreaTypeId` and `MemoryAreaType`.
4352

4453
## 0.16.0 (2023-06-23)
54+
4555
- **BREAKING** renamed `MULTIBOOT2_BOOTLOADER_MAGIC` to `MAGIC`
4656
- **BREAKING** `EFIMemoryDesc` was removed and is now an alias of
4757
`uefi_raw::table::boot::MemoryDescriptor`
4858
- **BREAKING** `EFIMemoryAreaType` was removed and is now an alias of
4959
`uefi_raw::table::boot::MemoryType`
5060
- **BREAKING** MSRV is 1.68.0
51-
- **BREAKING** Removed `MemoryAreaIter` and `MemoryMapTag::available_memory_areas`
52-
- **BREAKING** Renamed `BootInformation::load_base_addr` to `BootInformation::load_base_addr_tag`
53-
- **BREAKING** Renamed `BootInformation::efi_32_ih` to `BootInformation::efi_32_ih_tag`
54-
- **BREAKING** Renamed `BootInformation::efi_32_ih` to `BootInformation::efi_32_ih_tag`
61+
- **BREAKING** Removed `MemoryAreaIter`
62+
and `MemoryMapTag::available_memory_areas`
63+
- **BREAKING** Renamed `BootInformation::load_base_addr`
64+
to `BootInformation::load_base_addr_tag`
65+
- **BREAKING** Renamed `BootInformation::efi_32_ih`
66+
to `BootInformation::efi_32_ih_tag`
67+
- **BREAKING** Renamed `BootInformation::efi_32_ih`
68+
to `BootInformation::efi_32_ih_tag`
5569
- **BREAKING** Renamed `ImageLoadPhysAddr` to `ImageLoadPhysAddrTag`
5670
- **BREAKING** Renamed `EFIImageHandle32` to `EFIImageHandle32Tag`
5771
- **BREAKING** Renamed `EFIImageHandle64` to `EFIImageHandle64Tag`
5872
- **BREAKING** Renamed `EFISdt32` to `EFISdt32Tag`
5973
- **BREAKING** Renamed `EFISdt64` to `EFISdt64Tag`
60-
- **BREAKING** Renamed `EFIBootServicesNotExited` to `EFIBootServicesNotExitedTag`
61-
- **BREAKING** Renamed `CommandLineTag::command_line` renamed to `CommandLineTag::cmdline`
62-
- **\[Might be\] BREAKING** Added `TagTrait` trait which enables to use DSTs as multiboot2 tags. This is
74+
- **BREAKING** Renamed `EFIBootServicesNotExited`
75+
to `EFIBootServicesNotExitedTag`
76+
- **BREAKING** Renamed `CommandLineTag::command_line` renamed
77+
to `CommandLineTag::cmdline`
78+
- **\[Might be\] BREAKING** Added `TagTrait` trait which enables to use DSTs as
79+
multiboot2 tags. This is
6380
mostly relevant for the command line tag, the modules tag, and the bootloader
6481
name tag. However, this might also be relevant for users of custom multiboot2
6582
tags that use DSTs as types. See the example provided in the doc of the
@@ -72,6 +89,7 @@
7289
- added `MemoryMapTag::entry_size` and `MemoryMapTag::entry_version`
7390

7491
## 0.15.1 (2023-03-18)
92+
7593
- **BREAKING** `MemoryMapTag::all_memory_areas()` was renamed to `memory_areas`
7694
and now returns `MemoryAreaIter` instead of
7795
`impl Iterator<Item = &MemoryArea>`. Experience showed that its better to
@@ -86,14 +104,16 @@
86104
- fix: prevent a possible panic in `ElfSection::section_type()`
87105

88106
## 0.15.0 (2023-03-17)
107+
89108
- **BREAKING** MSRV is 1.56.1
90109
- **BREAKING** fixed lifetime issues: `VBEInfoTag` is no longer `&static`
91110
- **BREAKING:** `TagType` is now split into `TagTypeId` and `TagType`
92-
- `TagTypeId` is a binary-compatible form of a Multiboot2 tag id
93-
- `TagType` is a higher-level abstraction for either specified or custom tags
94-
but not ABI compatible.
95-
- There exists a seamless integration between `u32`, `TagType`, and
96-
`TagTypeId` via `From` and `PartialEq`-implementations.
111+
- `TagTypeId` is a binary-compatible form of a Multiboot2 tag id
112+
- `TagType` is a higher-level abstraction for either specified or custom
113+
tags
114+
but not ABI compatible.
115+
- There exists a seamless integration between `u32`, `TagType`, and
116+
`TagTypeId` via `From` and `PartialEq`-implementations.
97117
- fixed another internal lifetime issue
98118
- `BootInformation::framebuffer_tag()` now returns
99119
`Option<Result<FramebufferTag, UnknownFramebufferType>>` instead of
@@ -106,82 +126,102 @@
106126
from.
107127

108128
## 0.14.2 (2023-03-17)
129+
109130
- documentation fixes
110131
- `MbiLoadError` now implements `Display`
111132
- Added the `unstable` feature, which enables nightly-only functionality.
112133
With this feature, `MbiLoadError` now implements `core::error::Error` and can
113134
be used with `anyhow::Result` for example.
114135

115136
## 0.14.1 (2023-03-09)
116-
- fixed the calculation of the last area of the memory map tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119))
117-
(Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag)
137+
138+
- fixed the calculation of the last area of the memory map
139+
tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119))
140+
(Previously, iterating the EFI Memory map resulted in a superfluous entry as
141+
it ran over the next tag)
118142

119143
## 0.14.0 (2022-06-30)
144+
120145
- **BREAKING CHANGES** \
121-
This version includes a few small breaking changes that brings more safety when parsing strings from the
146+
This version includes a few small breaking changes that brings more safety
147+
when parsing strings from the
122148
multiboot information structure.
123-
- `BootLoaderNameTag::name` now returns a Result instead of just the value
124-
- `CommandLineTag::command_line` now returns a Result instead of just the value
125-
- `ModuleTag::cmdline` now returns a Result instead of just the value
126-
- `RsdpV1Tag::signature` now returns a Result instead of an Option
127-
- `RsdpV1Tag::oem_id` now returns a Result instead of an Option
128-
- `RsdpV2Tag::signature` now returns a Result instead of an Option
129-
- `RsdpV2Tag::oem_id` now returns a Result instead of an Option
149+
- `BootLoaderNameTag::name` now returns a Result instead of just the value
150+
- `CommandLineTag::command_line` now returns a Result instead of just the
151+
value
152+
- `ModuleTag::cmdline` now returns a Result instead of just the value
153+
- `RsdpV1Tag::signature` now returns a Result instead of an Option
154+
- `RsdpV1Tag::oem_id` now returns a Result instead of an Option
155+
- `RsdpV2Tag::signature` now returns a Result instead of an Option
156+
- `RsdpV2Tag::oem_id` now returns a Result instead of an Option
130157
- internal code improvements
131158

132159
## 0.13.3 (2022-06-03)
160+
133161
- impl `Send` for `BootInformation`
134162

135163
## 0.13.2 (2022-05-02)
164+
136165
- `TagType` now implements `Ord` so that it can be used in `BTreeSet`
137-
- small internal improvements and restructuring of the code (no breaking changes to public API)
166+
- small internal improvements and restructuring of the code (no breaking changes
167+
to public API)
138168

139169
## 0.13.1 (2022-01-09)
170+
140171
- minor fix
141172

142173
## 0.13.0 (**yanked**)
174+
143175
- added missing getters for tag `ImageLoadPhysAddr`
144176
- added missing getters for tags `EFIImageHandle32` and `EFIImageHandle64`
145177

146178
## 0.12.2 (2021-10-02)
179+
147180
- `TagType` now implements `Eq` and `Hash`
148181
- internal improvements
149-
- `std` can be used in tests; the crate is still `no_std`
150-
- this implies that `cargo test` doesn't work on "non-standard" targets
151-
- CI (Ubuntu) still works.
152-
- code formatting/style
153-
- sensible style checks as optional CI job
154-
- `.editorconfig` file
155-
- prepared co-existence of crates `multiboot2` and `multiboot2-header`
156-
in a Cargo workspace inside the same repository
182+
- `std` can be used in tests; the crate is still `no_std`
183+
- this implies that `cargo test` doesn't work on "non-standard" targets
184+
- CI (Ubuntu) still works.
185+
- code formatting/style
186+
- sensible style checks as optional CI job
187+
- `.editorconfig` file
188+
- prepared co-existence of crates `multiboot2` and `multiboot2-header`
189+
in a Cargo workspace inside the same repository
157190

158191
## 0.12.1 (2021-08-11)
192+
159193
- `TagType`-enum introduced in `v0.11` is now actually public
160194
- internal code improvements
161195

162196
## 0.12.0 (2021-08-06)
197+
163198
- **breaking:** `load()` and `load_with_offset` now returns a result
164199
- added public constant `MULTIBOOT2_BOOTLOADER_MAGIC`
165200
- Rust edition 2018 (instead of 2015)
166201
- internal code improvements
167202

168203
## 0.11.0 (2021-07-07)
169204

170-
- **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`) return `impl Iterator` instead of a concrete type
205+
- **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`)
206+
return `impl Iterator` instead of a concrete type
171207
- lib now contains `TagType`-enum that contains
172208
all possible mbi tags that are specified (taken from spec)
173209
- much improved debug-formatting of `BootInformation`
174210
- internal code improvements / formatting
175211

176212
## 0.10.0 (2020-11-03)
213+
177214
- allow access to all memory regions (MemoryMap-Tag)
178215
- internal code improvements
179216

180217
## 0.9.0 (2020-07-06)
181218

182-
- Add a `checksum_is_valid` method to the RSDP tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64))
219+
- Add a `checksum_is_valid` method to the RSDP
220+
tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64))
183221

184222
## 0.8.2 (2022-03-02)
185223

186-
- Add some basic documentation ([#62](https://github.com/rust-osdev/multiboot2/pull/62))
187-
- Add MemoryAreaType, to allow users to access memory area types in a type-safe way ([#61](https://github.com/rust-osdev/multiboot2/pull/61))
224+
- Add some basic
225+
documentation ([#62](https://github.com/rust-osdev/multiboot2/pull/62))
226+
- Add MemoryAreaType, to allow users to access memory area types in a type-safe
227+
way ([#61](https://github.com/rust-osdev/multiboot2/pull/61))

multiboot2/src/builder/information.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ impl core::error::Error for RedundantTagError {}
6464
#[derive(Debug, PartialEq, Eq)]
6565
pub struct InformationBuilder(Vec<(TagType, SerializedTag)>);
6666

67+
impl Default for InformationBuilder {
68+
fn default() -> Self {
69+
Self::new()
70+
}
71+
}
72+
6773
impl InformationBuilder {
6874
/// Creates a new builder.
6975
pub const fn new() -> Self {

0 commit comments

Comments
 (0)