tag:blogger.com,1999:blog-34374221.post4820375311101189030..comments2024-03-03T07:35:45.002+01:00Comments on geekAbyte: IntoIterator and the for ... in Syntax in Rustdadehttp://www.blogger.com/profile/01934137473204182228noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-34374221.post-12821104445721574602022-08-23T15:48:48.663+02:002022-08-23T15:48:48.663+02:00Thanks! Updated!Thanks! Updated!dadehttps://www.blogger.com/profile/01934137473204182228noreply@blogger.comtag:blogger.com,1999:blog-34374221.post-85023063279766033732022-08-23T10:35:21.382+02:002022-08-23T10:35:21.382+02:00There are a few into_inter that should be into_ite...There are a few into_inter that should be into_iter.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34374221.post-50200271449930583982022-08-18T19:40:37.499+02:002022-08-18T19:40:37.499+02:00Thanks for spotting that. I have updated with the ...Thanks for spotting that. I have updated with the correction.dadehttps://www.blogger.com/profile/01934137473204182228noreply@blogger.comtag:blogger.com,1999:blog-34374221.post-84020935664108480252022-08-18T10:26:14.350+02:002022-08-18T10:26:14.350+02:00Very clear explanation.
The is a small copy/paste...Very clear explanation.<br /><br />The is a small copy/paste error :<br /><br />fn main() {<br /> let some_ints = vec![1,2,3];<br /> // calling for_each directly on a Vec won't compile<br /> some_ints.iter()(|item| {<br /> dbg!(item);<br /> });<br />}<br /><br />As you are trying to demonstrate non-compiling code this should be some_ints.for_each(), as confirmed by the rustc error message below.<br /><br />Anonymousnoreply@blogger.com