vhost-device-gpu: Fix format and lint issues

These are minor formatting and linter fixes

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
This commit is contained in:
Dorinda Bassey 2025-11-13 14:17:51 +01:00 committed by Stefano Garzarella
parent 736c5d109d
commit dff8efdd2b
2 changed files with 5 additions and 4 deletions

View file

@ -257,9 +257,10 @@ pub fn start_backend(socket_path: &Path, config: GpuConfig) -> Result<(), StartE
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use assert_matches::assert_matches;
use std::path::Path; use std::path::Path;
use assert_matches::assert_matches;
use super::*; use super::*;
#[test] #[test]
@ -343,7 +344,7 @@ mod tests {
fn test_capset_display_multiple() { fn test_capset_display_multiple() {
let capset = GpuCapset::VIRGL | GpuCapset::VIRGL2; let capset = GpuCapset::VIRGL | GpuCapset::VIRGL2;
let output = capset.to_string(); let output = capset.to_string();
assert_eq!(output, "virgl, virgl2") assert_eq!(output, "virgl, virgl2");
} }
/// Check if display name of GpuMode is the same as the name in the CLI arg /// Check if display name of GpuMode is the same as the name in the CLI arg

View file

@ -173,9 +173,9 @@ mod tests {
} }
// Convert each CapsetName into GpuCapset // Convert each CapsetName into GpuCapset
for capset_name in CapsetName::value_variants().iter().cloned() { for capset_name in CapsetName::value_variants().iter().copied() {
let resulting_capset: GpuCapset = capset_name.into(); // Would panic! if the definition is incorrect let resulting_capset: GpuCapset = capset_name.into(); // Would panic! if the definition is incorrect
assert_eq!(resulting_capset.bits(), capset_name as u64) assert_eq!(resulting_capset.bits(), capset_name as u64);
} }
} }