diff options
| author | king6cong <king6cong@gmail.com> | 2017-04-15 11:43:35 +0800 |
|---|---|---|
| committer | king6cong <king6cong@gmail.com> | 2017-04-15 11:43:35 +0800 |
| commit | 7c8ca80c8120cbc6a1d703f2af2f0397dd86f997 (patch) | |
| tree | 545ca0244520b87a414f219b30f7bf7d63ceadaa /src/libcore | |
| parent | f0ca5d4bad07a4fc8497bd9766cdadaee1bd0ac6 (diff) | |
| download | rust-7c8ca80c8120cbc6a1d703f2af2f0397dd86f997.tar.gz rust-7c8ca80c8120cbc6a1d703f2af2f0397dd86f997.zip | |
code format
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/iterator.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 8bf641e37fe..3ad91ef15ea 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -2164,16 +2164,16 @@ pub trait Iterator { } } -/// Select an element from an iterator based on the given projection +/// Select an element from an iterator based on the given "projection" /// and "comparison" function. /// /// This is an idiosyncratic helper to try to factor out the /// commonalities of {max,min}{,_by}. In particular, this avoids /// having to implement optimizations several times. #[inline] -fn select_fold1<I,B, FProj, FCmp>(mut it: I, - mut f_proj: FProj, - mut f_cmp: FCmp) -> Option<(B, I::Item)> +fn select_fold1<I, B, FProj, FCmp>(mut it: I, + mut f_proj: FProj, + mut f_cmp: FCmp) -> Option<(B, I::Item)> where I: Iterator, FProj: FnMut(&I::Item) -> B, FCmp: FnMut(&B, &I::Item, &B, &I::Item) -> bool @@ -2186,7 +2186,7 @@ fn select_fold1<I,B, FProj, FCmp>(mut it: I, for x in it { let x_p = f_proj(&x); - if f_cmp(&sel_p, &sel, &x_p, &x) { + if f_cmp(&sel_p, &sel, &x_p, &x) { sel = x; sel_p = x_p; } |
