Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uefi/src/helpers/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<W: fmt::Write> fmt::Write for DecoratedLog<'_, '_, W> {
// If the string ends with a newline character, we must 1/propagate it
// to the output (it was swallowed by the iteration) and 2/prepare to
// write the log level of the beginning of the next line (if any).
if let Some('\n') = s.chars().next_back() {
if s.ends_with('\n') {
writeln!(self.writer)?;
self.at_line_start = true;
}
Expand Down
4 changes: 2 additions & 2 deletions uefi/src/proto/media/file/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Directory {
let read_entry_res = self.read_entry(&mut []);

// If no more entries are available, return early.
if let Ok(None) = read_entry_res {
if read_entry_res == Ok(None) {
return Ok(None);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ impl Directory {
let read_entry_res = self.read_entry(&mut []);

// If no more entries are available, return early.
if let Ok(None) = read_entry_res {
if read_entry_res == Ok(None) {
return Ok(None);
}

Expand Down
9 changes: 4 additions & 5 deletions uefi/src/proto/tcg/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,13 @@ impl Tcg {
data_to_hash: Option<&[u8]>,
) -> Result {
let hash_data;
let hash_data_len;
if let Some(data_to_hash) = data_to_hash {
let hash_data_len = if let Some(data_to_hash) = data_to_hash {
hash_data = data_to_hash.as_ptr() as PhysicalAddress;
hash_data_len = u64::try_from(data_to_hash.len()).unwrap();
u64::try_from(data_to_hash.len()).unwrap()
} else {
hash_data = 0;
hash_data_len = 0;
}
0
};

// Don't bother returning these, it's not very useful info.
let mut event_number = 0;
Expand Down
3 changes: 1 addition & 2 deletions uefi/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,13 @@ impl Iterator for VariableKeys {
}))
}
Err(err) => {
self.is_done = true;
if err.status() == Status::NOT_FOUND {
// This status indicates the end of the list. The final variable
// has already been yielded at this point, so return `None`.
self.is_done = true;
None
} else {
// Return the error and end iteration.
self.is_done = true;
Some(Err(err.to_err_without_payload()))
}
}
Expand Down
Loading