mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tpm: remove mixture of str and Path
`impl AsRef<Path>` is the most idiomatic way to consume paths in Rust. I removed the mixture. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
c53781bf5f
commit
afcb2b285f
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
use std::cmp;
|
||||
use std::path::Path;
|
||||
use std::sync::{Arc, Barrier};
|
||||
|
||||
use anyhow::anyhow;
|
||||
@@ -227,7 +228,7 @@ pub struct Tpm {
|
||||
}
|
||||
|
||||
impl Tpm {
|
||||
pub fn new(path: &str) -> Result<Self> {
|
||||
pub fn new(path: impl AsRef<Path>) -> Result<Self> {
|
||||
let emulator = Emulator::new(path)
|
||||
.map_err(|e| Error::Init(anyhow!("Failed while initializing tpm Emulator: {e:?}")))?;
|
||||
let mut tpm = Tpm {
|
||||
|
||||
Reference in New Issue
Block a user