検索
Results of 21 - 30 of about 148 for println (0.044 sec.)
- Resultをイテレートする - Rust By Example 日本語版 6806
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
into_iter() .map(|s| s.parse::<i32>()) .collect(); println!("Results: {:?}", numbers); } ここでは、この対処法...
.filter_map(|s| s.parse::<i32>().ok()) .collect(); println!("Results: {:?}", numbers); } collect() で処理全体...
into_iter() .map(|s| s.parse::<i32>()) .collect(); println!("Results: {:?}", numbers); } 同じテクニックは、 O...
p(|s| s.parse::<i32>()) .partition(Result::is_ok); println!("Numbers: {:?}", numbers); println!("Errors: {:?}...
- https://man.plustar.jp/rust/example/error/iter_result.html - [similar]
- クローン - Rust By Example 日本語版 6806
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
ndependently // いずれの`Unit`も独立に使用できる。 println!("original: {:?}", unit); println!("copy: {:?}", c...
スを作成 let pair = Pair(Box::new(1), Box::new(2)); println!("original: {:?}", pair); // Move `pair` into `mov...
動、資源は移動(`move`)する。 let moved_pair = pair; println!("moved: {:?}", moved_pair); // Error! `pair` has...
resources // エラー! `pair`は資源を失っている。 //println!("original: {:?}", pair); // TODO ^ Try uncommenti...
- https://man.plustar.jp/rust/example/trait/clone.html - [similar]
- key型の変種 - Rust By Example 日本語版 6747
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
counts<'a>, username: &'a str, password: &'a str){ println!("Username: {}", username); println!("Password: {}...
", password); println!("Attempting logon..."); let logon = Account { use...
tch accounts.get(&logon) { Some(account_info) => { println!("Successful logon!"); println!("Name: {}", accoun...
t_info.name); println!("Email: {}", account_info.email); }, _ => println...
- https://man.plustar.jp/rust/example/std/hash/alt_key_types.html - [similar]
- 要素の捕捉 - Rust By Example 日本語版 6641
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
rrowed until `print` is used the last time. // // `println!` only requires arguments by immutable reference s...
。 // 借用は`print`がスコープから出るまで続く。 // `println!`は参照を与えれば機能するので、これ以上なにかする必...
要はない。 let print = || println!("`color`: {}", color); // Call the closure using...
内部変数を変更する。 let mut inc = || { count += 1; println!("`count`: {}", count); }; // Call the closure usi...
- https://man.plustar.jp/rust/example/fn/closures/capture.html - [similar]
- OptionからResultを取り出す - Rust By Example 日本語版 6583
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
= vec![]; let strings = vec!["tofu", "93", "18"]; println!("The first doubled is {:?}", double_first(numbers...
)); println!("The first doubled is {:?}", double_first(empty))...
input vector is empty // エラー1:入力が空ベクトル println!("The first doubled is {:?}", double_first(strings...
= vec![]; let strings = vec!["tofu", "93", "18"]; println!("The first doubled is {:?}", double_first(numbers...
- https://man.plustar.jp/rust/example/error/multiple_error_types/option_result.htm... - [similar]
- match - Rust By Example 日本語版 6583
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
= 13; // TODO ^ Try different values for `number` println!("Tell me about {}", number); match number { // Ma...
single value // 単一の値とのマッチをチェック 1 => println!("One!"), // Match several values // いくつかの値と...
のマッチをチェック 2 | 3 | 5 | 7 | 11 => println!("This is a prime"), // TODO ^ Try adding 13 to th...
e // 特定の範囲の値とのマッチをチェック 13..=19 => println!("A teen"), // Handle the rest of cases // その他の...
- https://man.plustar.jp/rust/example/flow_control/match.html - [similar]
- 引数のパース - Rust By Example 日本語版 6583
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
できます。 use std::env; fn increase(number: i32) { println!("{}", number + 1); } fn decrease(number: i32) { p...
rintln!("{}", number - 1); } fn help() { println!("usage: match_args <string> Check whether given s...
{ // no arguments passed // 引数がない場合 1 => { println!("My name is 'match_args'. Try passing some argume...
1つの場合 2 => { match args[1].parse() { Ok(42) => println!("This is the answer!"), _ => println!("This is no...
- https://man.plustar.jp/rust/example/std_misc/arg/matching.html - [similar]
- メモリ解放 - Rust By Example 日本語版 6583
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
す。 impl Drop for Droppable { fn drop(&mut self) { println!("> Dropping {}", self.name); } } fn main() { let...
e { name: "c" }; let _d = Droppable { name: "d" }; println!("Exiting block B"); } println!("Just exited block...
B"); println!("Exiting block A"); } println!("Just exited block...
e // TODO ^ この行をコメントアウトしてみましょう。 println!("end of the main function"); // `_a` *won't* be `...
- https://man.plustar.jp/rust/example/trait/drop.html - [similar]
- ファイルの階層構造 - Rust By Example 日本語版 6536
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
ることができるようにします。 mod my; fn function() { println!("called `function()`"); } fn main() { my::functio...
inaccessible; pub mod nested; pub fn function() { println!("called `my::function()`"); } fn private_function...
() { println!("called `my::private_function()`"); } pub fn indi...
unction(); } In my/nested.rs : pub fn function() { println!("called `my::nested::function()`"); } #[allow(dea...
- https://man.plustar.jp/rust/example/mod/split.html - [similar]
- ハッシュ集合 - Rust By Example 日本語版 6418
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
は`[elem1, elem2, ...]`のように要素をプリントする。 println!("A: {:?}", a); println!("B: {:?}", b); // Print [...
bitrary order // [1, 2, 3, 4, 5]を順不同にプリント println!("Union: {:?}", a.union(&b).collect::<Vec<&i32>>()...
); // This should print [1] // これは[1]をプリント println!("Difference: {:?}", a.difference(&b).collect::<Ve...
in arbitrary order. // [2, 3, 4]を順不同にプリント println!("Intersection: {:?}", a.intersection(&b).collect:...
- https://man.plustar.jp/rust/example/std/hash/hashset.html - [similar]