From 43c1865f72787aa3cf6a6c736a36cf54ee8238ca Mon Sep 17 00:00:00 2001 From: iTrooz Date: Tue, 14 May 2024 11:20:26 +0200 Subject: [PATCH] chore: fix clippy warnings from Rust 78 --- efivar/src/efi/variable_flags.rs | 8 ++++---- efivarcli/src/cli/read.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/efivar/src/efi/variable_flags.rs b/efivar/src/efi/variable_flags.rs index d2713c1d..d729c1ab 100644 --- a/efivar/src/efi/variable_flags.rs +++ b/efivar/src/efi/variable_flags.rs @@ -1,6 +1,6 @@ //! Definition of the VariableFlags type -use std::str::FromStr; +use std::{fmt::Display, str::FromStr}; use crate::Error; @@ -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) { @@ -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")) } } diff --git a/efivarcli/src/cli/read.rs b/efivarcli/src/cli/read.rs index 7cd1915d..0ccc63f9 100644 --- a/efivarcli/src/cli/read.rs +++ b/efivarcli/src/cli/read.rs @@ -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 {