Sign in
android
/
toolchain
/
rustc
/
43f0694b1feb1296004d84509e01177159e71be0
/
.
/
src
/
test
/
ui
/
iterators
/
iter-range.rs
blob: 993d93790e0392375438ea3340c01f8f3db1a7d5 [
file
] [
log
] [
blame
]
// run-pass
fn
range_
<
F
>(
a
:
isize
,
b
:
isize
,
mut
it
:
F
)
where F
:
FnMut
(
isize
)
{
assert
!((
a
<
b
));
let
mut
i
:
isize
=
a
;
while
i
<
b
{
it
(
i
);
i
+=
1
;
}
}
pub
fn
main
()
{
let
mut
sum
:
isize
=
0
;
range_
(
0
,
100
,
|
x
|
sum
+=
x
);
println
!(
"{}"
,
sum
);
}