Skip to content

Commit

Permalink
chore: fix clippy warnings from Rust 78
Browse files Browse the repository at this point in the history
  • Loading branch information
iTrooz committed May 14, 2024
1 parent 1c22eba commit 43c1865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions efivar/src/efi/variable_flags.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Definition of the VariableFlags type

use std::str::FromStr;
use std::{fmt::Display, str::FromStr};

use crate::Error;

Expand Down Expand Up @@ -51,8 +51,8 @@ impl FromStr for VariableFlags {
}
}

impl ToString for VariableFlags {
fn to_string(&self) -> String {
impl Display for VariableFlags {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut flag_strings = Vec::new();

if self.contains(VariableFlags::NON_VOLATILE) {
Expand Down Expand Up @@ -80,7 +80,7 @@ impl ToString for VariableFlags {
flag_strings.push("EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS");
}

flag_strings.join("\n")
f.write_str(&flag_strings.join("\n"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion efivarcli/src/cli/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn run(
match reader.read(&name) {
Ok((buf, attr)) => {
if !raw {
println!("Attributes: {}", attr.to_string());
println!("Attributes: {}", attr);
}
if as_string {
if raw {
Expand Down

0 comments on commit 43c1865

Please sign in to comment.