From 59fd877aa2cfcc43759e4a25679332f6238f9763 Mon Sep 17 00:00:00 2001 From: Mark Hurenkamp Date: Wed, 30 Oct 2024 23:59:07 +0100 Subject: [PATCH] fix warnings --- src/config/display/gtk.rs | 6 ------ src/config/gpu/passthrough_gpu.rs | 8 -------- src/config/gpu/virtio_vga_gl.rs | 8 -------- src/config/system/bios.rs | 3 +-- src/config/system/bios/ovmf.rs | 6 ------ src/config/system/chipset/q35.rs | 6 ------ src/config/system/tpm.rs | 3 +-- src/config/system/tpm/swtpm.rs | 4 ---- 8 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/config/display/gtk.rs b/src/config/display/gtk.rs index 078db08..b59fe7b 100644 --- a/src/config/display/gtk.rs +++ b/src/config/display/gtk.rs @@ -1,5 +1,4 @@ use crate::config::display::Display; -use crate::config::gpu::Gpu; use crate::config::qemu_device::QemuDevice; use serde::Deserialize; @@ -7,11 +6,6 @@ use serde::Deserialize; pub struct Gtk { gl: bool, } -impl Gtk { - pub fn boxed_default() -> Box { - Box::new(Self { gl: true }) - } -} impl QemuDevice for Gtk { fn get_qemu_args(&self, _index: usize) -> Vec { diff --git a/src/config/gpu/passthrough_gpu.rs b/src/config/gpu/passthrough_gpu.rs index 35e4302..168c1f3 100644 --- a/src/config/gpu/passthrough_gpu.rs +++ b/src/config/gpu/passthrough_gpu.rs @@ -8,14 +8,6 @@ pub struct PassthroughGpu { pci: Vec, } -impl PassthroughGpu { - pub fn boxed_default() -> Box { - Box::new(Self { - pci: Default::default(), - }) - } -} - impl QemuDevice for PassthroughGpu { fn get_qemu_args(&self, _index: usize) -> Vec { let mut result = vec![]; diff --git a/src/config/gpu/virtio_vga_gl.rs b/src/config/gpu/virtio_vga_gl.rs index 0021369..cef7a9b 100644 --- a/src/config/gpu/virtio_vga_gl.rs +++ b/src/config/gpu/virtio_vga_gl.rs @@ -8,14 +8,6 @@ pub struct VirtioVgaGl { pci_address: String, } -impl VirtioVgaGl { - pub fn boxed_default() -> Box { - Box::new(Self { - pci_address: default_pci_address(), - }) - } -} - fn default_pci_address() -> String { "0x2".to_string() } diff --git a/src/config/system/bios.rs b/src/config/system/bios.rs index 1fa41d8..fddb565 100644 --- a/src/config/system/bios.rs +++ b/src/config/system/bios.rs @@ -1,6 +1,5 @@ use crate::config::qemu_device::QemuDevice; -pub use crate::config::system::bios::ovmf::OVMF; -pub use crate::config::system::bios::seabios::SeaBios; +use crate::config::system::bios::seabios::SeaBios; mod ovmf; mod seabios; diff --git a/src/config/system/bios/ovmf.rs b/src/config/system/bios/ovmf.rs index f660f70..b578408 100644 --- a/src/config/system/bios/ovmf.rs +++ b/src/config/system/bios/ovmf.rs @@ -11,12 +11,6 @@ pub struct OVMF { uuid: String, } -impl OVMF { - pub fn new(file: String, uuid: String) -> Self { - Self { file, uuid } - } -} - impl QemuDevice for OVMF { fn get_qemu_args(&self, _index: usize) -> Vec { vec![ diff --git a/src/config/system/chipset/q35.rs b/src/config/system/chipset/q35.rs index 8413689..f9c435c 100644 --- a/src/config/system/chipset/q35.rs +++ b/src/config/system/chipset/q35.rs @@ -27,12 +27,6 @@ impl QemuDevice for Q35 { } } -impl Q35 { - pub fn new() -> Self { - Self {} - } -} - #[typetag::deserialize(name = "q35")] impl Chipset for Q35 {} diff --git a/src/config/system/tpm.rs b/src/config/system/tpm.rs index 5c98bf4..450e614 100644 --- a/src/config/system/tpm.rs +++ b/src/config/system/tpm.rs @@ -1,6 +1,5 @@ use crate::config::qemu_device::QemuDevice; -pub use crate::config::system::tpm::no_tpm::NoTpm; -pub use crate::config::system::tpm::swtpm::SwTpm; +use crate::config::system::tpm::no_tpm::NoTpm; mod no_tpm; mod pass_through_tpm; diff --git a/src/config/system/tpm/swtpm.rs b/src/config/system/tpm/swtpm.rs index 40661f8..d34ae8b 100644 --- a/src/config/system/tpm/swtpm.rs +++ b/src/config/system/tpm/swtpm.rs @@ -19,10 +19,6 @@ pub struct SwTpm { impl Tpm for SwTpm {} impl SwTpm { - pub fn new(disk: String, socket: String) -> Self { - Self { disk, socket } - } - fn spawn(&self, uid: u32, gid: u32, name: String) -> Result { Command::new("/usr/bin/env") .args(self.get_args())