From baaa12939cadde2a8805a155c5672d48ba353265 Mon Sep 17 00:00:00 2001 From: CM-IV Date: Thu, 18 Sep 2025 11:20:26 -0500 Subject: [PATCH] impl Debug for I2cdev --- src/i2c.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/i2c.rs b/src/i2c.rs index 854b39a..3db6528 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -42,6 +42,17 @@ impl I2cdev { } } +impl fmt::Debug for I2cdev { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("I2cdev") + .field("path", &self.path) + .field("address", &self.address) + // For the inner field we provide a placeholder, i2cdev does not impl Debug for LinuxI2CDevice + .field("inner", &format!("LinuxI2CDevice", self.path)) + .finish() + } +} + impl ops::Deref for I2cdev { type Target = i2cdev::linux::LinuxI2CDevice;