Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93583a6

Browse files
committed
Simplifytry_* onIterator
1 parent209f8c8 commit93583a6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

‎core/src/iter/traits/iterator.rs‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,8 +2080,7 @@ pub trait Iterator {
20802080
fntry_collect<B>(&mutself) ->ChangeOutputType<Self::Item,B>
20812081
where
20822082
Self:Sized,
2083-
<SelfasIterator>::Item:Try,
2084-
<<SelfasIterator>::ItemasTry>::Residual:Residual<B>,
2083+
Self::Item:Try<Residual:Residual<B>>,
20852084
B:FromIterator<<Self::ItemasTry>::Output>,
20862085
{
20872086
try_process(ByRefSized(self), |i| i.collect())
@@ -2689,12 +2688,13 @@ pub trait Iterator {
26892688
#[inline]
26902689
#[unstable(feature ="iterator_try_reduce", reason ="new API", issue ="87053")]
26912690
#[rustc_do_not_const_check]
2692-
fntry_reduce<F,R>(&mutself,f:F) ->ChangeOutputType<R,Option<R::Output>>
2691+
fntry_reduce<R>(
2692+
&mutself,
2693+
f:implFnMut(Self::Item,Self::Item) ->R,
2694+
) ->ChangeOutputType<R,Option<R::Output>>
26932695
where
26942696
Self:Sized,
2695-
F:FnMut(Self::Item,Self::Item) ->R,
2696-
R:Try<Output =Self::Item>,
2697-
R::Residual:Residual<Option<Self::Item>>,
2697+
R:Try<Output =Self::Item,Residual:Residual<Option<Self::Item>>>,
26982698
{
26992699
let first =matchself.next(){
27002700
Some(i) => i,
@@ -2956,12 +2956,13 @@ pub trait Iterator {
29562956
#[inline]
29572957
#[unstable(feature ="try_find", reason ="new API", issue ="63178")]
29582958
#[rustc_do_not_const_check]
2959-
fntry_find<F,R>(&mutself,f:F) ->ChangeOutputType<R,Option<Self::Item>>
2959+
fntry_find<R>(
2960+
&mutself,
2961+
f:implFnMut(&Self::Item) ->R,
2962+
) ->ChangeOutputType<R,Option<Self::Item>>
29602963
where
29612964
Self:Sized,
2962-
F:FnMut(&Self::Item) ->R,
2963-
R:Try<Output =bool>,
2964-
R::Residual:Residual<Option<Self::Item>>,
2965+
R:Try<Output =bool,Residual:Residual<Option<Self::Item>>>,
29652966
{
29662967
#[inline]
29672968
fncheck<I,V,R>(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp