From 6200b6b341160c3e690122af56bb227b8a165a00 Mon Sep 17 00:00:00 2001 From: Matt Bilker Date: Mon, 6 Feb 2023 01:57:13 +0000 Subject: [PATCH] nvidia(ctrla081): print whole signature if any byte is non-zero --- src/nvidia/ctrla081.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nvidia/ctrla081.rs b/src/nvidia/ctrla081.rs index 759df10..42c3c55 100644 --- a/src/nvidia/ctrla081.rs +++ b/src/nvidia/ctrla081.rs @@ -76,10 +76,11 @@ pub struct NvA081CtrlCmdVgpuConfigGetMigrationCapParams { impl fmt::Debug for NvA081CtrlVgpuInfo { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let vgpu_signature = self.vgpu_signature[..] - .split(|&x| x == 0) - .next() - .unwrap_or(&[]); + let vgpu_signature = if self.vgpu_signature[..].iter().any(|&x| x != 0) { + &self.vgpu_signature[..] + } else { + &[] + }; let vgpu_extra_params = self.vgpu_extra_params[..] .split(|&x| x == 0) .next()