From 5323da031c9612a6c16a46f9536e4f65bf803229 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 23 Sep 2019 19:15:50 +0200 Subject: [PATCH] vmm: Make RngConfig owned Convert Path to PathBuf and remove the associated lifetime. Fixes #298 Signed-off-by: Samuel Ortiz --- vmm/src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vmm/src/config.rs b/vmm/src/config.rs index ef539641c..a8f523679 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -268,14 +268,14 @@ impl NetConfig { } } -pub struct RngConfig<'a> { - pub src: &'a Path, +pub struct RngConfig { + pub src: PathBuf, } -impl<'a> RngConfig<'a> { - pub fn parse(rng: &'a str) -> Result { +impl RngConfig { + pub fn parse(rng: &str) -> Result { Ok(RngConfig { - src: Path::new(rng), + src: PathBuf::from(rng), }) } } @@ -615,7 +615,7 @@ pub struct VmConfig<'a> { pub cmdline: CmdlineConfig, pub disks: Option>, pub net: Option>, - pub rng: RngConfig<'a>, + pub rng: RngConfig, pub fs: Option>>, pub pmem: Option>>, pub serial: ConsoleConfig<'a>,