Skip to content

Commit 4f5ed82

Browse files
Doumancarllerche
authored andcommitted
Fix clippy (#285)
1 parent ae9991f commit 4f5ed82

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed
File renamed without changes.

src/buf/chain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl<T, U> Chain<T, U> {
5050
/// ```
5151
pub fn new(a: T, b: U) -> Chain<T, U> {
5252
Chain {
53-
a: a,
54-
b: b,
53+
a,
54+
b,
5555
}
5656
}
5757

src/buf/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<T> IntoIter<T> {
4545
/// assert_eq!(iter.next(), None);
4646
/// ```
4747
pub fn new(inner: T) -> IntoIter<T> {
48-
IntoIter { inner: inner }
48+
IntoIter { inner }
4949
}
5050
/// Consumes this `IntoIter`, returning the underlying value.
5151
///

src/buf/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! [`Buf`]: trait.Buf.html
1717
//! [`BufMut`]: trait.BufMut.html
1818
19-
mod buf;
19+
mod buf_impl;
2020
mod buf_mut;
2121
mod chain;
2222
mod iter;
@@ -25,7 +25,7 @@ mod take;
2525
mod vec_deque;
2626
mod writer;
2727

28-
pub use self::buf::Buf;
28+
pub use self::buf_impl::Buf;
2929
pub use self::buf_mut::BufMut;
3030
pub use self::chain::Chain;
3131
pub use self::iter::IntoIter;

src/buf/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Reader<B> {
1313
}
1414

1515
pub fn new<B>(buf: B) -> Reader<B> {
16-
Reader { buf: buf }
16+
Reader { buf }
1717
}
1818

1919
impl<B: Buf> Reader<B> {

src/buf/take.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pub struct Take<T> {
1414

1515
pub fn new<T>(inner: T, limit: usize) -> Take<T> {
1616
Take {
17-
inner: inner,
18-
limit: limit,
17+
inner,
18+
limit,
1919
}
2020
}
2121

src/buf/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Writer<B> {
1313
}
1414

1515
pub fn new<B>(buf: B) -> Writer<B> {
16-
Writer { buf: buf }
16+
Writer { buf }
1717
}
1818

1919
impl<B: BufMut> Writer<B> {

src/bytes.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ const MAX_VEC_POS: usize = usize::MAX >> VEC_POS_OFFSET;
357357
const NOT_VEC_POS_MASK: usize = 0b11111;
358358

359359
// Bit op constants for extracting the inline length value from the `arc` field.
360-
const INLINE_LEN_MASK: usize = 0b11111100;
360+
const INLINE_LEN_MASK: usize = 0b1111_1100;
361361
const INLINE_LEN_OFFSET: usize = 2;
362362

363363
// Byte offset from the start of `Inner` to where the inline buffer data
@@ -1671,7 +1671,7 @@ impl<'a> From<&'a [u8]> for BytesMut {
16711671
inner.as_raw()[0..len].copy_from_slice(src);
16721672

16731673
BytesMut {
1674-
inner: inner,
1674+
inner,
16751675
}
16761676
}
16771677
} else {
@@ -1825,7 +1825,7 @@ impl Inner {
18251825
// track the fact that the `Bytes` handle is backed by a
18261826
// static buffer.
18271827
arc: AtomicPtr::new(KIND_STATIC as *mut Shared),
1828-
ptr: ptr,
1828+
ptr,
18291829
len: bytes.len(),
18301830
cap: bytes.len(),
18311831
}
@@ -1844,9 +1844,9 @@ impl Inner {
18441844

18451845
Inner {
18461846
arc: AtomicPtr::new(arc as *mut Shared),
1847-
ptr: ptr,
1848-
len: len,
1849-
cap: cap,
1847+
ptr,
1848+
len,
1849+
cap,
18501850
}
18511851
}
18521852

@@ -1987,7 +1987,7 @@ impl Inner {
19871987
self.set_end(at);
19881988
}
19891989

1990-
return other
1990+
other
19911991
}
19921992

19931993
fn split_to(&mut self, at: usize) -> Inner {
@@ -1998,7 +1998,7 @@ impl Inner {
19981998
self.set_start(at);
19991999
}
20002000

2001-
return other
2001+
other
20022002
}
20032003

20042004
fn truncate(&mut self, len: usize) {
@@ -2246,7 +2246,7 @@ impl Inner {
22462246
// vector.
22472247
let shared = Box::new(Shared {
22482248
vec: rebuild_vec(self.ptr, self.len, self.cap, off),
2249-
original_capacity_repr: original_capacity_repr,
2249+
original_capacity_repr,
22502250
// Initialize refcount to 2. One for this reference, and one
22512251
// for the new clone that will be returned from
22522252
// `shallow_clone`.

0 commit comments

Comments
 (0)