-
Rust연습❤️) Collect & Vec 조합 Closure활용코딩Coding/Rust연습 2022. 6. 23. 17:51728x90
fn main() { let my_vec = ((-10..=10).map(|x| (x, x* x))).collect::<Vec<_>>(); println!("{my_vec:?}"); }
결과 :Standard Error Compiling playground v0.0.1 (/playground) Finished dev [unoptimized + debuginfo] target(s) in 4.09s Running `target/debug/playground` Standard Output [(-10, 100), (-9, 81), (-8, 64), (-7, 49), (-6, 36), (-5, 25), (-4, 16), (-3, 9), (-2, 4), (-1, 1), (0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49), (8, 64), (9, 81), (10, 100)]
Rust❤️take & collect methods 사용법 1분 53초에 나옴 & skip(3분30초 -
https://economiceco.tistory.com/m/14121Rust❤️take & collect methods 사용법 1분 53초에 나옴 & skip(3분30초
1분53초 https://youtu.be/LNfhXppiiW8 Fold method again https://youtu.be/lG651CzNFmM
economiceco.tistory.com
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust연습❤️] Hello from asm__assembly코드 연습 (0) 2022.07.03 Rust연습❤️] Displaying raw pointers (0) 2022.07.03 Rust연습❤️내 컴퓨터에 병렬 실행 가능한 코어수 알아보기available_parallelism (0) 2022.06.29 Rust – Fibonacci using Recursion and Iteration (0) 2022.06.26 Rust연습)그래프 그리기 + 움직이는 별 표현하기(움직이는 gif만들기) (0) 2022.06.15 Rust연습] tuple연습❤️ & ndarray ❤️연습 (0) 2022.06.02 Rust연습] Cow__120 Easy Rust in Korean: to_mut with Cow (0) 2022.04.19 Rust연습]Cow part2 (0) 2022.04.19