Skip to content

Commit b208e12

Browse files
committed
multiboot2: streamline code style
1 parent 776a980 commit b208e12

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

multiboot2/src/boot_loader_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
use crate::tag::{StringError, TagHeader};
44
use crate::{Tag, TagTrait, TagType, TagTypeId};
55
use core::fmt::{Debug, Formatter};
6-
use core::mem::size_of;
6+
use core::mem;
77
#[cfg(feature = "builder")]
88
use {crate::builder::BoxedDst, alloc::vec::Vec};
99

10-
const METADATA_SIZE: usize = size_of::<TagTypeId>() + size_of::<u32>();
10+
const METADATA_SIZE: usize = mem::size_of::<TagTypeId>() + mem::size_of::<u32>();
1111

1212
/// The bootloader name tag.
1313
#[derive(ptr_meta::Pointee, PartialEq, Eq, PartialOrd, Ord, Hash)]

multiboot2/src/command_line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core::str;
88
#[cfg(feature = "builder")]
99
use {crate::builder::BoxedDst, alloc::vec::Vec};
1010

11-
pub const METADATA_SIZE: usize = mem::size_of::<TagTypeId>() + mem::size_of::<u32>();
11+
const METADATA_SIZE: usize = mem::size_of::<TagTypeId>() + mem::size_of::<u32>();
1212

1313
/// This tag contains the command line string.
1414
///

multiboot2/src/elf_sections.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
use crate::builder::BoxedDst;
55
use crate::{Tag, TagTrait, TagType, TagTypeId};
66
use core::fmt::{Debug, Formatter};
7-
use core::mem::size_of;
7+
use core::mem;
88
use core::str::Utf8Error;
99

10-
const METADATA_SIZE: usize = size_of::<TagTypeId>() + 4 * size_of::<u32>();
10+
const METADATA_SIZE: usize = mem::size_of::<TagTypeId>() + 4 * mem::size_of::<u32>();
1111

1212
/// This tag contains the section header table from an ELF binary.
1313
// The sections iterator is provided via the [`ElfSectionsTag::sections`]

multiboot2/src/framebuffer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::tag::TagHeader;
44
use crate::{Tag, TagTrait, TagType, TagTypeId};
55
use core::fmt::Debug;
6-
use core::mem::size_of;
6+
use core::mem;
77
use core::slice;
88
use derive_more::Display;
99
#[cfg(feature = "builder")]
@@ -42,11 +42,11 @@ impl Reader {
4242
}
4343
}
4444

45-
const METADATA_SIZE: usize = size_of::<TagTypeId>()
46-
+ 4 * size_of::<u32>()
47-
+ size_of::<u64>()
48-
+ size_of::<u16>()
49-
+ 2 * size_of::<u8>();
45+
const METADATA_SIZE: usize = mem::size_of::<TagTypeId>()
46+
+ 4 * mem::size_of::<u32>()
47+
+ mem::size_of::<u64>()
48+
+ mem::size_of::<u16>()
49+
+ 2 * mem::size_of::<u8>();
5050

5151
/// The VBE Framebuffer information tag.
5252
#[derive(ptr_meta::Pointee, Eq)]

multiboot2/src/module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
use crate::tag::{StringError, TagHeader, TagIter};
44
use crate::{Tag, TagTrait, TagType, TagTypeId};
55
use core::fmt::{Debug, Formatter};
6-
use core::mem::size_of;
6+
use core::mem;
77
#[cfg(feature = "builder")]
88
use {crate::builder::BoxedDst, alloc::vec::Vec};
99

10-
const METADATA_SIZE: usize = size_of::<TagTypeId>() + 3 * size_of::<u32>();
10+
const METADATA_SIZE: usize = mem::size_of::<TagTypeId>() + 3 * mem::size_of::<u32>();
1111

1212
/// The module tag can occur multiple times and specifies passed boot modules
1313
/// (blobs in memory). The tag itself doesn't include the blog, but references

multiboot2/src/smbios.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use crate::builder::BoxedDst;
55
use crate::tag::TagHeader;
66
use crate::{Tag, TagTrait, TagType, TagTypeId};
77
use core::fmt::Debug;
8+
use core::mem;
89

9-
const METADATA_SIZE: usize = core::mem::size_of::<TagTypeId>()
10-
+ core::mem::size_of::<u32>()
11-
+ core::mem::size_of::<u8>() * 8;
10+
const METADATA_SIZE: usize =
11+
mem::size_of::<TagTypeId>() + mem::size_of::<u32>() + mem::size_of::<u8>() * 8;
1212

1313
/// This tag contains a copy of SMBIOS tables as well as their version.
1414
#[derive(ptr_meta::Pointee, PartialEq, Eq, PartialOrd, Ord, Hash)]

0 commit comments

Comments
 (0)