Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Slattery committed Aug 30, 2024
1 parent 74c4e55 commit f234969
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions embedded-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,28 +372,30 @@ impl<const N: usize, R: ?Sized> BufReader<N, R> {
&self.inner
}

/// Gets a mutable reference to the underlying reader.
pub fn get_mut(&mut self) -> &mut R {
&mut self.inner
}

/// Returns a reference to the internally buffered data.
///
/// Unlike `fill_buff` this will not attempt to fill the buffer it if is empty.
pub fn buffer(&self) -> &[u8] {
&self.buff
}

/// Returns the number of bytes the internal buffer can hold at once.
pub fn capacity(&self) -> usize {
N
}

/// Unwraps this [BufReader<N,R>], returning the underlying reader.
pub fn into_inner(self) -> R
where
R: Sized,
{
self.inner
}

pub fn discard_buffer(&mut self) {
self.pos = 0;
}
}

impl<const N: usize, R: Read> BufReader<N, R> {
Expand Down

0 comments on commit f234969

Please sign in to comment.