diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-10-16 23:23:10 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-16 23:23:10 +0000 |
| commit | 7fd868ade91ebd92cf68016cd40cbbad30a5918e (patch) | |
| tree | d2a94357c0e192a4ec633aaa57b9579f2f2b2922 /embassy-usb/src/types.rs | |
| parent | 6e6df229795e3ff44fc213e03e022bf38f2de47e (diff) | |
| parent | 31d4516516940720101300a40d0d6d2bb8d1728e (diff) | |
Merge pull request #2068 from barafael/const_usb_config_builder_new
Constify UsbDevice Config::new (and clippy fixes) in embassy-usb
Diffstat (limited to 'embassy-usb/src/types.rs')
| -rw-r--r-- | embassy-usb/src/types.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-usb/src/types.rs b/embassy-usb/src/types.rs index c7a47f7e4..cb9fe2576 100644 --- a/embassy-usb/src/types.rs +++ b/embassy-usb/src/types.rs | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | pub struct InterfaceNumber(pub u8); | 7 | pub struct InterfaceNumber(pub u8); |
| 8 | 8 | ||
| 9 | impl InterfaceNumber { | 9 | impl InterfaceNumber { |
| 10 | pub(crate) fn new(index: u8) -> InterfaceNumber { | 10 | pub(crate) const fn new(index: u8) -> InterfaceNumber { |
| 11 | InterfaceNumber(index) | 11 | InterfaceNumber(index) |
| 12 | } | 12 | } |
| 13 | } | 13 | } |
| @@ -25,7 +25,7 @@ impl From<InterfaceNumber> for u8 { | |||
| 25 | pub struct StringIndex(pub u8); | 25 | pub struct StringIndex(pub u8); |
| 26 | 26 | ||
| 27 | impl StringIndex { | 27 | impl StringIndex { |
| 28 | pub(crate) fn new(index: u8) -> StringIndex { | 28 | pub(crate) const fn new(index: u8) -> StringIndex { |
| 29 | StringIndex(index) | 29 | StringIndex(index) |
| 30 | } | 30 | } |
| 31 | } | 31 | } |
