Skip to content

Commit 8fa63ac

Browse files
committed
Derive common traits for public types
1 parent 69121a8 commit 8fa63ac

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
88

99
## [Unreleased]
1010

11-
- Relax lifetime constraint on `I2CTransfer::transfer` `msgs` reference
11+
- Relax lifetime constraint on `I2CTransfer::transfer` `msgs` reference.
12+
- Derived common traits for public types.
1213

1314
## [v0.6.1] - 2024-05-09
1415

src/linux.rs

+2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ use std::path::Path;
2323
pub use core::I2CMessage;
2424

2525
/// Concrete linux I2C device
26+
#[derive(Debug)]
2627
pub struct LinuxI2CDevice {
2728
devfile: File,
2829
slave_address: u16,
2930
pec: bool,
3031
}
3132

3233
/// Linux I2C bus
34+
#[derive(Debug)]
3335
pub struct LinuxI2CBus {
3436
devfile: File,
3537
}

src/mock.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::io;
1313
pub type I2CResult<T> = io::Result<T>;
1414

1515
/// Mock I2C device register map
16+
#[derive(Debug, Clone, Copy)]
1617
pub struct I2CRegisterMap {
1718
registers: [u8; 0xFF],
1819
offset: usize,
@@ -67,7 +68,7 @@ impl I2CRegisterMap {
6768
}
6869

6970
/// Mock I2C device exposing a register map
70-
#[derive(Default)]
71+
#[derive(Default, Debug, Clone, Copy)]
7172
pub struct MockI2CDevice {
7273
/// I2C register map
7374
pub regmap: I2CRegisterMap,

0 commit comments

Comments
 (0)