Skip to content

Commit ea42ead

Browse files
committed
build: Use formatted strings
Signed-off-by: Akira Moroo <[email protected]>
1 parent 446dda3 commit ea42ead

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/arch/x86_64/paging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn setup() {
2727
// CR3. Thus, it is safe to run multiple times or on multiple threads.
2828
#[allow(static_mut_refs)]
2929
let (l4, l3, l2s) = unsafe { (L4_TABLE.get_mut(), L3_TABLE.get_mut(), L2_TABLES.get_mut()) };
30-
info!("Setting up {} GiB identity mapping", ADDRESS_SPACE_GIB);
30+
info!("Setting up {ADDRESS_SPACE_GIB} GiB identity mapping");
3131
let pt_flags = PageTableFlags::PRESENT | PageTableFlags::WRITABLE;
3232

3333
// Setup Identity map using L2 huge pages

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn boot_from_device(
113113
info: &dyn bootinfo::Info,
114114
) -> Result<(), Error> {
115115
if let Err(err) = device.init() {
116-
error!("Error configuring block device: {:?}", err);
116+
error!("Error configuring block device: {err:?}");
117117
return Err(Error::Virtio(err));
118118
}
119119
info!(
@@ -124,15 +124,15 @@ fn boot_from_device(
124124
let (start, end) = match part::find_efi_partition(device) {
125125
Ok(p) => p,
126126
Err(err) => {
127-
error!("Failed to find EFI partition: {:?}", err);
127+
error!("Failed to find EFI partition: {err:?}");
128128
return Err(Error::Partition(err));
129129
}
130130
};
131131
info!("Found EFI partition");
132132

133133
let mut f = fat::Filesystem::new(device, start, end);
134134
if let Err(err) = f.init() {
135-
error!("Failed to create filesystem: {:?}", err);
135+
error!("Failed to create filesystem: {err:?}");
136136
return Err(Error::Fat(err));
137137
}
138138
info!("Filesystem ready");
@@ -144,7 +144,7 @@ fn boot_from_device(
144144
return Ok(());
145145
}
146146
Err(err) => {
147-
warn!("Error loading default entry: {:?}", err);
147+
warn!("Error loading default entry: {err:?}");
148148
// Fall through to EFI boot
149149
}
150150
}
@@ -154,7 +154,7 @@ fn boot_from_device(
154154
let mut file = match f.open(efi::EFI_BOOT_PATH) {
155155
Ok(file) => file,
156156
Err(err) => {
157-
error!("Failed to load default EFI binary: {:?}", err);
157+
error!("Failed to load default EFI binary: {err:?}");
158158
return Err(Error::Fat(err));
159159
}
160160
};
@@ -165,7 +165,7 @@ fn boot_from_device(
165165
let (entry_addr, load_addr, size) = match l.load(info.kernel_load_addr()) {
166166
Ok(load_info) => load_info,
167167
Err(err) => {
168-
error!("Error loading executable: {:?}", err);
168+
error!("Error loading executable: {err:?}");
169169
return Err(Error::Pe(err));
170170
}
171171
};

src/pci.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ pub fn print_bus() {
153153
if vendor_id == INVALID_VENDOR_ID {
154154
continue;
155155
}
156-
info!(
157-
"Found PCI device vendor={:x} device={:x} in slot={}",
158-
vendor_id, device_id, device
159-
);
156+
info!("Found PCI device vendor={vendor_id:x} device={device_id:x} in slot={device}");
160157
}
161158
}
162159

0 commit comments

Comments
 (0)