style(lib): address most clippy lints
This commit is contained in:
committed by
Sean McArthur
parent
0f13719873
commit
0eaf304644
@@ -34,10 +34,7 @@ impl<T: Buf> Buf for BufList<T> {
|
||||
|
||||
#[inline]
|
||||
fn bytes(&self) -> &[u8] {
|
||||
for buf in &self.bufs {
|
||||
return buf.bytes();
|
||||
}
|
||||
&[]
|
||||
self.bufs.front().map(Buf::bytes).unwrap_or_default()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
@@ -58,11 +58,11 @@ where
|
||||
) -> Poll<io::Result<usize>> {
|
||||
if let Some(mut prefix) = self.pre.take() {
|
||||
// If there are no remaining bytes, let the bytes get dropped.
|
||||
if prefix.len() > 0 {
|
||||
if !prefix.is_empty() {
|
||||
let copy_len = cmp::min(prefix.len(), buf.len());
|
||||
prefix.copy_to_slice(&mut buf[..copy_len]);
|
||||
// Put back whats left
|
||||
if prefix.len() > 0 {
|
||||
if !prefix.is_empty() {
|
||||
self.pre = Some(prefix);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,8 @@ where
|
||||
type Output = R::Output;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
|
||||
match self.inner {
|
||||
Inner::Fut(ref mut f) => return Pin::new(f).poll(cx),
|
||||
_ => (),
|
||||
if let Inner::Fut(ref mut f) = self.inner {
|
||||
return Pin::new(f).poll(cx);
|
||||
}
|
||||
|
||||
match mem::replace(&mut self.inner, Inner::Empty) {
|
||||
|
||||
Reference in New Issue
Block a user