Skip to content

Commit 4724c7e

Browse files
authored
remove new fns from combinator structs (#434)
This is not idiomatic.
1 parent ced0507 commit 4724c7e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/buf/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct Chain<T, U> {
3838

3939
impl<T, U> Chain<T, U> {
4040
/// Creates a new `Chain` sequencing the provided values.
41-
pub fn new(a: T, b: U) -> Chain<T, U> {
41+
pub(crate) fn new(a: T, b: U) -> Chain<T, U> {
4242
Chain { a, b }
4343
}
4444

src/buf/iter.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,16 @@ impl<T> IntoIter<T> {
3434
///
3535
/// ```
3636
/// use bytes::Bytes;
37-
/// use bytes::buf::IntoIter;
3837
///
3938
/// let buf = Bytes::from_static(b"abc");
40-
/// let mut iter = IntoIter::new(buf);
39+
/// let mut iter = buf.into_iter();
4140
///
4241
/// assert_eq!(iter.next(), Some(b'a'));
4342
/// assert_eq!(iter.next(), Some(b'b'));
4443
/// assert_eq!(iter.next(), Some(b'c'));
4544
/// assert_eq!(iter.next(), None);
4645
/// ```
47-
pub fn new(inner: T) -> IntoIter<T> {
46+
pub(crate) fn new(inner: T) -> IntoIter<T> {
4847
IntoIter { inner }
4948
}
5049

0 commit comments

Comments
 (0)