Skip to content

Commit

Permalink
Provide BuilderError through prelude
Browse files Browse the repository at this point in the history
Also adds documentation strings to BuilderError
  • Loading branch information
ianrrees committed Nov 15, 2023
1 parent 808b1a4 commit 01e15c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [0.3.1] - 2023-11-15

### Added
* `LangID` in `prelude` and `class_prelude`, `StringDescriptors` in `prelude`
* `BuilderError`, `LangID`, `StringDescriptors` now in `prelude`
* `LangID` now in `class_prelude`

### Changed
* Updated documentation, including example code
Expand Down
4 changes: 4 additions & 0 deletions src/device_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ macro_rules! builder_fields {
}

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

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ pub mod prelude {
pub use crate::device::{
StringDescriptors, UsbDevice, UsbDeviceBuilder, UsbDeviceState, UsbVidPid,
};
pub use crate::device_builder::BuilderError;
pub use crate::LangID;
pub use crate::UsbError;
}
Expand Down

0 comments on commit 01e15c2

Please sign in to comment.