Skip to content

Commit eaba606

Browse files
committed
Derive common traits for public types
1 parent 594860e commit eaba606

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

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

99
## [Unreleased]
1010

11+
- Derived common traits for public types.
12+
1113
## [v0.6.0] - 2023-08-03
1214

1315
- Hide nix from the public api such that it can be updated without resulting in a breaking change.

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
@@ -12,6 +12,7 @@ use std::io;
1212
pub type I2CResult<T> = io::Result<T>;
1313

1414
/// Mock I2C device register map
15+
#[derive(Debug, Clone, Copy)]
1516
pub struct I2CRegisterMap {
1617
registers: [u8; 0xFF],
1718
offset: usize,
@@ -61,7 +62,7 @@ impl I2CRegisterMap {
6162
}
6263

6364
/// Mock I2C device exposing a register map
64-
#[derive(Default)]
65+
#[derive(Default, Debug, Clone, Copy)]
6566
pub struct MockI2CDevice {
6667
/// I2C register map
6768
pub regmap: I2CRegisterMap,

0 commit comments

Comments
 (0)