Merge pull request #2413 from JomerDev/better-read_packet-doc

Add buffer size info to read_packet docs
This commit is contained in:
Dario Nieuwenhuis 2024-01-07 23:08:46 +00:00 committed by GitHub
commit 49ee0564ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -439,6 +439,7 @@ impl<'d, D: Driver<'d>> Receiver<'d, D> {
} }
/// Reads a single packet from the OUT endpoint. /// Reads a single packet from the OUT endpoint.
/// Must be called with a buffer large enough to hold max_packet_size bytes.
pub async fn read_packet(&mut self, data: &mut [u8]) -> Result<usize, EndpointError> { pub async fn read_packet(&mut self, data: &mut [u8]) -> Result<usize, EndpointError> {
self.read_ep.read(data).await self.read_ep.read(data).await
} }