|
| 1 | +use crate::HeaderTagType; |
| 2 | +#[cfg(feature = "builder")] |
| 3 | +use crate::StructAsBytes; |
1 | 4 | use crate::{HeaderTagFlag, MbiTagType};
|
2 |
| -use crate::{HeaderTagType, StructAsBytes}; |
| 5 | +#[cfg(feature = "builder")] |
| 6 | +use alloc::collections::BTreeSet; |
| 7 | +#[cfg(feature = "builder")] |
| 8 | +use alloc::vec::Vec; |
3 | 9 | use core::fmt;
|
4 | 10 | use core::fmt::{Debug, Formatter};
|
5 | 11 | use core::marker::PhantomData;
|
6 | 12 | use core::mem::size_of;
|
7 |
| -use std::collections::HashSet; |
8 | 13 |
|
9 | 14 | /// Specifies what specific tag types the bootloader should provide
|
10 | 15 | /// inside the mbi.
|
@@ -87,21 +92,24 @@ impl<const N: usize> Debug for InformationRequestHeaderTag<N> {
|
87 | 92 | }
|
88 | 93 | }
|
89 | 94 |
|
90 |
| -impl<const N: usize> StructAsBytes for InformationRequestHeaderTag<N> {} |
| 95 | +#[cfg(feature = "builder")] |
| 96 | +impl<const N: usize> crate::StructAsBytes for InformationRequestHeaderTag<N> {} |
91 | 97 |
|
92 | 98 | /// Helper to build the dynamically sized [`InformationRequestHeaderTag`]
|
93 | 99 | /// at runtime.
|
94 | 100 | #[derive(Debug)]
|
| 101 | +#[cfg(feature = "builder")] |
95 | 102 | pub struct InformationRequestHeaderTagBuilder {
|
96 | 103 | flag: HeaderTagFlag,
|
97 |
| - irs: HashSet<MbiTagType>, |
| 104 | + irs: BTreeSet<MbiTagType>, |
98 | 105 | }
|
99 | 106 |
|
| 107 | +#[cfg(feature = "builder")] |
100 | 108 | impl InformationRequestHeaderTagBuilder {
|
101 | 109 | /// New builder.
|
102 | 110 | pub fn new(flag: HeaderTagFlag) -> Self {
|
103 | 111 | Self {
|
104 |
| - irs: HashSet::new(), |
| 112 | + irs: BTreeSet::new(), |
105 | 113 | flag,
|
106 | 114 | }
|
107 | 115 | }
|
|
0 commit comments