diff options
| author | Rafael Bachmann <[email protected]> | 2023-10-15 23:45:44 +0200 |
|---|---|---|
| committer | Rafael Bachmann <[email protected]> | 2023-10-15 23:52:44 +0200 |
| commit | 31d4516516940720101300a40d0d6d2bb8d1728e (patch) | |
| tree | ce44bfebf56fea7726bccae7d2617efd360af319 /embassy-usb/src/descriptor_reader.rs | |
| parent | 66e62e999409fd6967ab959a061f7eae660102d0 (diff) | |
Apply Pedantic Clippy Lints
Diffstat (limited to 'embassy-usb/src/descriptor_reader.rs')
| -rw-r--r-- | embassy-usb/src/descriptor_reader.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-usb/src/descriptor_reader.rs b/embassy-usb/src/descriptor_reader.rs index 05adcce60..abb4b379e 100644 --- a/embassy-usb/src/descriptor_reader.rs +++ b/embassy-usb/src/descriptor_reader.rs | |||
| @@ -11,11 +11,11 @@ pub struct Reader<'a> { | |||
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | impl<'a> Reader<'a> { | 13 | impl<'a> Reader<'a> { |
| 14 | pub fn new(data: &'a [u8]) -> Self { | 14 | pub const fn new(data: &'a [u8]) -> Self { |
| 15 | Self { data } | 15 | Self { data } |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | pub fn eof(&self) -> bool { | 18 | pub const fn eof(&self) -> bool { |
| 19 | self.data.is_empty() | 19 | self.data.is_empty() |
| 20 | } | 20 | } |
| 21 | 21 | ||
| @@ -102,7 +102,7 @@ pub fn foreach_endpoint(data: &[u8], mut f: impl FnMut(EndpointInfo)) -> Result< | |||
| 102 | } | 102 | } |
| 103 | descriptor_type::ENDPOINT => { | 103 | descriptor_type::ENDPOINT => { |
| 104 | ep.ep_address = EndpointAddress::from(r.read_u8()?); | 104 | ep.ep_address = EndpointAddress::from(r.read_u8()?); |
| 105 | f(ep) | 105 | f(ep); |
| 106 | } | 106 | } |
| 107 | _ => {} | 107 | _ => {} |
| 108 | } | 108 | } |
