Skip to content

Commit 3355de2

Browse files
committed
Reformat and fix CI
1 parent ed5d408 commit 3355de2

File tree

13 files changed

+51
-34
lines changed

13 files changed

+51
-34
lines changed

src/proto/console/gop.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,23 @@
2323
//! In theory, a buffer with a width of 640 should have (640 * 4) bytes per row,
2424
//! but in practice there might be some extra padding used for efficiency.
2525
26+
use crate::{Completion, Result, Status};
2627
use core::marker::PhantomData;
2728
use core::mem;
2829
use core::ptr;
29-
use crate::{Completion, Result, Status};
3030

3131
/// Provides access to the video hardware's frame buffer.
3232
///
3333
/// The GOP can be used to set the properties of the frame buffer,
3434
/// and also allows the app to access the in-memory buffer.
3535
#[repr(C)]
3636
pub struct GraphicsOutput<'boot> {
37-
query_mode:
38-
extern "win64" fn(&GraphicsOutput, mode: u32, info_sz: &mut usize, &mut *const ModeInfo)
39-
-> Status,
37+
query_mode: extern "win64" fn(
38+
&GraphicsOutput,
39+
mode: u32,
40+
info_sz: &mut usize,
41+
&mut *const ModeInfo,
42+
) -> Status,
4043
set_mode: extern "win64" fn(&mut GraphicsOutput, mode: u32) -> Status,
4144
// Clippy correctly complains that this is too complicated, but we can't change the spec.
4245
#[allow(clippy::type_complexity)]

src/proto/console/pointer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Pointer device access.
22
3-
use core::mem;
43
use crate::{Event, Result, Status};
4+
use core::mem;
55

66
/// Provides information about a pointer device.
77
#[repr(C)]

src/proto/console/serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Abstraction over byte stream devices, also known as serial I/O devices.
22
3-
use bitflags::bitflags;
43
use crate::{Completion, Result, Status};
4+
use bitflags::bitflags;
55

66
/// Provides access to a serial I/O device.
77
///

src/proto/console/text/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use core::mem;
21
use crate::{Char16, Event, Result, Status};
2+
use core::mem;
33

44
/// Interface for text-based input devices.
55
#[repr(C)]

src/proto/console/text/output.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use core::fmt;
21
use crate::prelude::*;
32
use crate::{CStr16, Char16, Completion, Result, Status};
3+
use core::fmt;
44

55
/// Interface for text-based output devices.
66
///
@@ -11,8 +11,12 @@ pub struct Output<'boot> {
1111
reset: extern "win64" fn(this: &Output, extended: bool) -> Status,
1212
output_string: extern "win64" fn(this: &Output, string: *const Char16) -> Status,
1313
test_string: extern "win64" fn(this: &Output, string: *const Char16) -> Status,
14-
query_mode: extern "win64" fn(this: &Output, mode: i32, columns: &mut usize, rows: &mut usize)
15-
-> Status,
14+
query_mode: extern "win64" fn(
15+
this: &Output,
16+
mode: i32,
17+
columns: &mut usize,
18+
rows: &mut usize,
19+
) -> Status,
1620
set_mode: extern "win64" fn(this: &mut Output, mode: i32) -> Status,
1721
set_attribute: extern "win64" fn(this: &mut Output, attribute: usize) -> Status,
1822
clear_screen: extern "win64" fn(this: &mut Output) -> Status,

src/proto/media/file.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
//! `/` on that volume, and with that file it is possible to enumerate and open
66
//! all the other files on that volume.
77
8+
use crate::prelude::*;
9+
use crate::{CStr16, Char16, Result, Status};
810
use bitflags::bitflags;
911
use core::mem;
1012
use core::ptr;
11-
use crate::prelude::*;
12-
use crate::{CStr16, Char16, Result, Status};
1313
use ucs2;
1414

1515
/// A file represents an abstraction of some contiguous block of data residing
@@ -185,8 +185,11 @@ pub(super) struct FileImpl {
185185
delete: extern "win64" fn(this: &mut FileImpl) -> Status,
186186
read:
187187
extern "win64" fn(this: &mut FileImpl, buffer_size: &mut usize, buffer: *mut u8) -> Status,
188-
write: extern "win64" fn(this: &mut FileImpl, buffer_size: &mut usize, buffer: *const u8)
189-
-> Status,
188+
write: extern "win64" fn(
189+
this: &mut FileImpl,
190+
buffer_size: &mut usize,
191+
buffer: *const u8,
192+
) -> Status,
190193
get_position: extern "win64" fn(this: &mut FileImpl, position: &mut u64) -> Status,
191194
set_position: extern "win64" fn(this: &mut FileImpl, position: u64) -> Status,
192195
get_info: usize,

src/proto/media/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! File system support protocols.
22
33
use super::file::{File, FileImpl};
4-
use core::ptr;
54
use crate::{Result, Status};
5+
use core::ptr;
66

77
/// Allows access to a FAT-12/16/32 file system.
88
///

src/table/boot.rs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! UEFI services available during boot.
22
33
use super::Header;
4+
use crate::proto::Protocol;
5+
use crate::{Event, Guid, Handle, Result, Status};
46
use bitflags::bitflags;
57
use core::cell::UnsafeCell;
68
use core::ffi::c_void;
79
use core::{mem, ptr, result};
8-
use crate::proto::Protocol;
9-
use crate::{Event, Guid, Handle, Result, Status};
1010

1111
/// Contains pointers to all of the boot services.
1212
#[repr(C)]
@@ -18,9 +18,12 @@ pub struct BootServices {
1818
restore_tpl: extern "win64" fn(old_tpl: Tpl),
1919

2020
// Memory allocation functions
21-
allocate_pages:
22-
extern "win64" fn(alloc_ty: u32, mem_ty: MemoryType, count: usize, addr: &mut u64)
23-
-> Status,
21+
allocate_pages: extern "win64" fn(
22+
alloc_ty: u32,
23+
mem_ty: MemoryType,
24+
count: usize,
25+
addr: &mut u64,
26+
) -> Status,
2427
free_pages: extern "win64" fn(addr: u64, pages: usize) -> Status,
2528
memory_map: extern "win64" fn(
2629
size: &mut usize,
@@ -42,9 +45,11 @@ pub struct BootServices {
4245
event: *mut Event,
4346
) -> Status,
4447
set_timer: usize,
45-
wait_for_event:
46-
extern "win64" fn(number_of_events: usize, events: *mut Event, out_index: &mut usize)
47-
-> Status,
48+
wait_for_event: extern "win64" fn(
49+
number_of_events: usize,
50+
events: *mut Event,
51+
out_index: &mut usize,
52+
) -> Status,
4853
signal_event: usize,
4954
close_event: usize,
5055
check_event: usize,
@@ -53,9 +58,11 @@ pub struct BootServices {
5358
install_protocol_interface: usize,
5459
reinstall_protocol_interface: usize,
5560
uninstall_protocol_interface: usize,
56-
handle_protocol:
57-
extern "win64" fn(handle: Handle, proto: *const Guid, out_proto: &mut *mut c_void)
58-
-> Status,
61+
handle_protocol: extern "win64" fn(
62+
handle: Handle,
63+
proto: *const Guid,
64+
out_proto: &mut *mut c_void,
65+
) -> Status,
5966
_reserved: usize,
6067
register_protocol_notify: usize,
6168
locate_handle: extern "win64" fn(

src/table/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
1010
#![allow(clippy::unreadable_literal)]
1111

12+
use crate::Guid;
1213
use bitflags::bitflags;
1314
use core::ffi::c_void;
14-
use crate::Guid;
1515

1616
/// Contains a set of GUID / pointer for a vendor-specific table.
1717
///

src/table/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! UEFI services available at runtime, even after the OS boots.
22
33
use super::Header;
4-
use core::ptr;
54
use crate::Status;
5+
use core::ptr;
66

77
/// Contains pointers to all of the runtime services.
88
///

src/table/system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use super::boot::{BootServices, MemoryMapIter};
22
use super::runtime::RuntimeServices;
33
use super::{cfg, Header, Revision};
4-
use core::marker::PhantomData;
5-
use core::slice;
64
use crate::proto::console::text;
75
use crate::{CStr16, Char16, Handle, Result, Status};
6+
use core::marker::PhantomData;
7+
use core::slice;
88

99
/// Marker trait used to provide different views of the UEFI System Table
1010
pub trait SystemTableView {}

uefi-logger/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,22 @@ impl<'a, W: fmt::Write> fmt::Write for DecoratedLog<'a, W> {
110110
// beginning of a line of output.
111111
let first = lines.next().unwrap_or("");
112112
if self.at_line_start {
113-
write!(self.backend, "{}: ", self.log_level);
113+
write!(self.backend, "{}: ", self.log_level)?;
114114
self.at_line_start = false;
115115
}
116116
write!(self.backend, "{}", first)?;
117117

118118
// For the remainder of the line iterator (if any), we know that we are
119119
// truly at the beginning of lines of output.
120120
for line in lines {
121-
write!(self.backend, "\n{}: {}", self.log_level, line);
121+
write!(self.backend, "\n{}: {}", self.log_level, line)?;
122122
}
123123

124124
// If the string ends with a newline character, we must 1/propagate it
125125
// to the output (it was swallowed by the iteration) and 2/prepare to
126126
// write the log level of the beginning of the next line (if any).
127127
if let Some('\n') = s.chars().next_back() {
128-
writeln!(self.backend);
128+
writeln!(self.backend)?;
129129
self.at_line_start = true;
130130
}
131131
Ok(())

uefi-test-runner/src/boot/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use uefi::prelude::*;
22
use uefi::table::boot::{AllocateType, BootServices, MemoryDescriptor, MemoryType};
33

4-
use core::mem;
54
use crate::alloc::vec::Vec;
5+
use core::mem;
66

77
pub fn test(bt: &BootServices) {
88
info!("Testing memory functions");

0 commit comments

Comments
 (0)