chore: remove redundant field names in struct literals (#1334)

This commit is contained in:
Taiki Endo
2019-07-20 10:43:19 -07:00
committed by Carl Lerche
parent 1b2d997863
commit 9af07ce208
26 changed files with 33 additions and 43 deletions
+2 -2
View File
@@ -144,8 +144,8 @@ impl<T, U> Framed<T, U> {
FramedParts {
io: inner.0,
codec: inner.1,
read_buf: read_buf,
write_buf: write_buf,
read_buf,
write_buf,
_priv: (),
}
}
+2 -2
View File
@@ -138,7 +138,7 @@ where
pub fn framed_read2<T>(inner: T) -> FramedRead2<T> {
FramedRead2 {
inner: inner,
inner,
eof: false,
is_readable: false,
buffer: BytesMut::with_capacity(INITIAL_CAPACITY),
@@ -151,7 +151,7 @@ pub fn framed_read2_with_buffer<T>(inner: T, mut buf: BytesMut) -> FramedRead2<T
buf.reserve(bytes_to_reserve);
}
FramedRead2 {
inner: inner,
inner,
eof: false,
is_readable: buf.len() > 0,
buffer: buf,
+2 -5
View File
@@ -138,7 +138,7 @@ where
pub fn framed_write2<T>(inner: T) -> FramedWrite2<T> {
FramedWrite2 {
inner: inner,
inner,
buffer: BytesMut::with_capacity(INITIAL_CAPACITY),
}
}
@@ -148,10 +148,7 @@ pub fn framed_write2_with_buffer<T>(inner: T, mut buf: BytesMut) -> FramedWrite2
let bytes_to_reserve = INITIAL_CAPACITY - buf.capacity();
buf.reserve(bytes_to_reserve);
}
FramedWrite2 {
inner: inner,
buffer: buf,
}
FramedWrite2 { inner, buffer: buf }
}
impl<T> FramedWrite2<T> {