Skip to content

Commit 424329c

Browse files
committed
Provide BuilderError through prelude
Also adds documentation strings to BuilderError
1 parent 7a80498 commit 424329c

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
## [Unreleased]
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
## [0.3.0] - 2023-11-13
1415

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
@@ -185,6 +185,7 @@ pub mod prelude {
185185
pub use crate::device::{
186186
StringDescriptors, UsbDevice, UsbDeviceBuilder, UsbDeviceState, UsbVidPid,
187187
};
188+
pub use crate::device_builder::BuilderError;
188189
pub use crate::LangID;
189190
pub use crate::UsbError;
190191
}

0 commit comments

Comments
 (0)