@@ -625,8 +625,7 @@ pub(crate) fn href_relative_parts<'fqp>(
625625 let dissimilar_part_count = relative_to_fqp. len ( ) - i;
626626 let fqp_module = & fqp[ i..fqp. len ( ) ] ;
627627 return Box :: new (
628- iter:: repeat ( sym:: dotdot)
629- . take ( dissimilar_part_count)
628+ std:: iter:: repeat_n ( sym:: dotdot, dissimilar_part_count)
630629 . chain ( fqp_module. iter ( ) . copied ( ) ) ,
631630 ) ;
632631 }
@@ -639,7 +638,7 @@ pub(crate) fn href_relative_parts<'fqp>(
639638 Ordering :: Greater => {
640639 // e.g. linking to std::sync from std::sync::atomic
641640 let dissimilar_part_count = relative_to_fqp. len ( ) - fqp. len ( ) ;
642- Box :: new ( iter:: repeat ( sym:: dotdot) . take ( dissimilar_part_count) )
641+ Box :: new ( std :: iter:: repeat_n ( sym:: dotdot, dissimilar_part_count) )
643642 }
644643 Ordering :: Equal => {
645644 // linking to the same module
@@ -770,10 +769,9 @@ fn primitive_link_fragment(
770769 ExternalLocation :: Local => {
771770 let cname_sym = ExternalCrate { crate_num : def_id. krate } . name ( cx. tcx ( ) ) ;
772771 Some ( if cx. current . first ( ) == Some ( & cname_sym) {
773- iter:: repeat ( sym:: dotdot) . take ( cx. current . len ( ) - 1 ) . collect ( )
772+ std :: iter:: repeat_n ( sym:: dotdot, cx. current . len ( ) - 1 ) . collect ( )
774773 } else {
775- iter:: repeat ( sym:: dotdot)
776- . take ( cx. current . len ( ) )
774+ std:: iter:: repeat_n ( sym:: dotdot, cx. current . len ( ) )
777775 . chain ( iter:: once ( cname_sym) )
778776 . collect ( )
779777 } )
0 commit comments