Skip to content

Commit

Permalink
Fix clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Nov 19, 2024
1 parent dc03776 commit 45d0837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion bluer-tools/src/bluadv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct Opt {
/// Service data in the form "<service uuid>:<hex data>".
///
/// Can be specified multiple times.
#[clap(long, short = 's')]
service_data: Vec<ServiceData>,

Expand Down
10 changes: 5 additions & 5 deletions bluer/src/stream_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::sock;
#[derive(Debug)]
pub struct ReadHalf<'a>(pub(crate) &'a Stream);

impl<'a> ReadHalf<'a> {
impl ReadHalf<'_> {
/// Receives data on the socket from the remote address to which it is connected,
/// without removing that data from the queue.
/// On success, returns the number of bytes peeked.
Expand All @@ -36,13 +36,13 @@ impl<'a> ReadHalf<'a> {
}
}

impl<'a> AsRef<Stream> for ReadHalf<'a> {
impl AsRef<Stream> for ReadHalf<'_> {
fn as_ref(&self) -> &Stream {
self.0
}
}

impl<'a> AsyncRead for ReadHalf<'a> {
impl AsyncRead for ReadHalf<'_> {
fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut ReadBuf) -> Poll<Result<()>> {
self.0.socket.poll_recv_priv(cx, buf)
}
Expand All @@ -52,13 +52,13 @@ impl<'a> AsyncRead for ReadHalf<'a> {
#[derive(Debug)]
pub struct WriteHalf<'a>(pub(crate) &'a Stream);

impl<'a> AsRef<Stream> for WriteHalf<'a> {
impl AsRef<Stream> for WriteHalf<'_> {
fn as_ref(&self) -> &Stream {
self.0
}
}

impl<'a> AsyncWrite for WriteHalf<'a> {
impl AsyncWrite for WriteHalf<'_> {
fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll<Result<usize>> {
self.0.poll_write_priv(cx, buf)
}
Expand Down

0 comments on commit 45d0837

Please sign in to comment.