Skip to content

Commit 01e15c2

Browse files
committed
Provide BuilderError through prelude
Also adds documentation strings to BuilderError
1 parent 808b1a4 commit 01e15c2

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
## [0.3.1] - 2023-11-15
99

1010
### Added
11-
* `LangID` in `prelude` and `class_prelude`, `StringDescriptors` in `prelude`
11+
* `BuilderError`, `LangID`, `StringDescriptors` now in `prelude`
12+
* `LangID` now in `class_prelude`
1213

1314
### Changed
1415
* Updated documentation, including example code

src/device_builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ macro_rules! builder_fields {
2424
}
2525

2626
#[derive(Copy, Clone, Debug, PartialEq)]
27+
/// Error type for the USB device builder
2728
pub enum BuilderError {
29+
/// String descriptors were provided in more languages than are supported
2830
TooManyLanguages,
31+
/// Control endpoint can only be 8, 16, 32, or 64 byte max packet size
2932
InvalidPacketSize,
33+
/// Configuration specifies higher USB power draw than allowed
3034
PowerTooHigh,
3135
}
3236

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ pub mod prelude {
187187
pub use crate::device::{
188188
StringDescriptors, UsbDevice, UsbDeviceBuilder, UsbDeviceState, UsbVidPid,
189189
};
190+
pub use crate::device_builder::BuilderError;
190191
pub use crate::LangID;
191192
pub use crate::UsbError;
192193
}

0 commit comments

Comments
 (0)