検索
Results of 1 - 9 of about 9 for collect (0.002 sec.)
- impl Trait - Rust By Example 日本語版 12294
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...rim())) // Remove leading and trailing whitespace .collect() // Collect all strings in a row into a Vec<Strin...g> }) }) .collect() // Collect all lines into a Vec<Vec<String>> } p...rim())) // Remove leading and trailing whitespace .collect() // Collect all strings in a row into a Vec<Strin...g> }) }) .collect() // Collect all lines into a Vec<Vec<String>> } N... - https://man.plustar.jp/rust/example/trait/impl_trait.html - [similar]
- ハッシュ集合 - Rust By Example 日本語版 11090
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...以下の例でこれらをすべて見ていきましょう。 use std::collections::HashSet; fn main() { let mut a: HashSet<i32>...= vec![1i32, 2, 3].into_iter().collect(); let mut b: HashSet<i32> = vec![2i32, 3, 4].into..._iter().collect(); assert!(a.insert(4)); assert!(a.contains(&4));...行をコメントアウトしましょう。 b.insert(5); // If a collection's element type implements `Debug`, // then the... - https://man.plustar.jp/rust/example/std/hash/hashset.html - [similar]
- Resultをイテレートする - Rust By Example 日本語版 10677
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...= strings .into_iter() .map(|s| s.parse::<i32>()) .collect(); println!("Results: {:?}", numbers); } ここでは、...nto_iter() .filter_map(|s| s.parse::<i32>().ok()) .collect(); println!("Results: {:?}", numbers); } collect()...= strings .into_iter() .map(|s| s.parse::<i32>()) .collect(); println!("Results: {:?}", numbers); } 同じテクニ...: Vec<_> = numbers.into_iter().map(Result::unwrap).collect(); let errors: Vec<_> = errors.into_iter().map(Res... - https://man.plustar.jp/rust/example/error/iter_result.html - [similar]
- DRY (Don't Repeat Yourself) - Rust By Example 日本語版 8646
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...{ let mut x: Vec<_> = iter::repeat($x).take(size).collect(); let y: Vec<_> = iter::repeat($y).take(size).col...ect(); let z: Vec<_> = iter::repeat($z).take(size).collect(); super::$func(&mut x, &y); assert_eq!(x, z); } }... - https://man.plustar.jp/rust/example/macros/dry.html - [similar]
- Testcase: map-reduce - Rust By Example 日本語版 8646
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...***************************** * "Reduce" phase * * Collect our intermediate results, and combine them into a...**********************************************/ // collect each thread's intermediate results into a new Vec...// collect each child thread's return-value // combine each t... - https://man.plustar.jp/rust/example/std_misc/threads/testcase_mapreduce.html - [similar]
- 引数のパース - Rust By Example 日本語版 7423
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...} fn main() { let args: Vec<String> = env::args().collect(); match args.len() { // no arguments passed // 引... - https://man.plustar.jp/rust/example/std_misc/arg/matching.html - [similar]
- 引数処理 - Rust By Example 日本語版 7423
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...v; fn main() { let args: Vec<String> = env::args().collect(); // The first argument is the path that was used... - https://man.plustar.jp/rust/example/std_misc/arg.html - [similar]
- 文字列 - Rust By Example 日本語版 7297
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...複を除去 let mut chars: Vec<char> = pangram.chars().collect(); chars.sort(); chars.dedup(); // Create an empty... - https://man.plustar.jp/rust/example/std/str.html - [similar]
- ベクタ型 - Rust By Example 日本語版 7297
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...り当てなおされます。 fn main() { // Iterators can be collected into vectors // イテレータは要素を収集してベクタ...にすることができる。 let collected_iterator: Vec<i32> = (0..10).collect(); println!...("Collected (0..10) into: {:?}", collected_iterator); // The...row // エラー!イミュータブルなベクタは成長できない collected_iterator.push(0); // FIXME ^ Comment out this li... - https://man.plustar.jp/rust/example/std/vec.html - [similar]
PREV
1
NEXT