Skip to content

Commit

Permalink
remove new fns from combinator structs (#434)
Browse files Browse the repository at this point in the history
This is not idiomatic.
  • Loading branch information
carllerche committed Oct 18, 2020
1 parent ced0507 commit 4724c7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/buf/chain.rs
Expand Up @@ -38,7 +38,7 @@ pub struct Chain<T, U> {

impl<T, U> Chain<T, U> {
/// Creates a new `Chain` sequencing the provided values.
pub fn new(a: T, b: U) -> Chain<T, U> {
pub(crate) fn new(a: T, b: U) -> Chain<T, U> {
Chain { a, b }
}

Expand Down
5 changes: 2 additions & 3 deletions src/buf/iter.rs
Expand Up @@ -34,17 +34,16 @@ impl<T> IntoIter<T> {
///
/// ```
/// use bytes::Bytes;
/// use bytes::buf::IntoIter;
///
/// let buf = Bytes::from_static(b"abc");
/// let mut iter = IntoIter::new(buf);
/// let mut iter = buf.into_iter();
///
/// assert_eq!(iter.next(), Some(b'a'));
/// assert_eq!(iter.next(), Some(b'b'));
/// assert_eq!(iter.next(), Some(b'c'));
/// assert_eq!(iter.next(), None);
/// ```
pub fn new(inner: T) -> IntoIter<T> {
pub(crate) fn new(inner: T) -> IntoIter<T> {
IntoIter { inner }
}

Expand Down

0 comments on commit 4724c7e

Please sign in to comment.