2828 tips : impl IntoIterator < Item = impl Into < ObjectId > > ,
2929 ends : Option < impl IntoIterator < Item = impl Into < ObjectId > > > ,
3030 ) -> Self {
31- let mut builder = Self :: new ( find) . with_tips ( tips) ;
32- if let Some ( ends) = ends {
33- builder = builder. with_ends ( ends) ;
34- } ;
35- builder
31+ Self :: new ( find) . with_tips ( tips) . with_ends ( ends. into_iter ( ) . flatten ( ) )
3632 }
3733
3834 /// Create a new `Builder` for a [`Topo`] that reads commits from a
@@ -49,16 +45,18 @@ where
4945 }
5046 }
5147
52- /// Add commits to start reading from. The behavior is similar to specifying
53- /// additional `ends` in `git rev-list --topo-order ^ends tips`.
48+ /// Add commits to start reading from.
49+ ///
50+ /// The behavior is similar to specifying additional `ends` in `git rev-list --topo-order ^ends tips`.
5451 pub fn with_tips ( mut self , tips : impl IntoIterator < Item = impl Into < ObjectId > > ) -> Self {
5552 self . tips . extend ( tips. into_iter ( ) . map ( Into :: into) ) ;
5653 self
5754 }
5855
59- /// Add commits ending the traversal. These commits themselves will not be
60- /// read, i.e. the behavior is similar to specifying additional `ends` in
61- /// `git rev-list --topo-order ^ends tips`.
56+ /// Add commits ending the traversal.
57+ ///
58+ /// These commits themselves will not be read, i.e. the behavior is similar to specifying additional
59+ /// `ends` in `git rev-list --topo-order ^ends tips`.
6260 pub fn with_ends ( mut self , ends : impl IntoIterator < Item = impl Into < ObjectId > > ) -> Self {
6361 self . ends . extend ( ends. into_iter ( ) . map ( Into :: into) ) ;
6462 self
0 commit comments