検索
Results of 1 - 10 of about 18 for second (0.003 sec.)
- ?の導入 - Rust By Example 日本語版 11993
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ParseIntError; fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {...rst_number = first_number_str.parse::<i32>()?; let second_number = second_number_str.parse::<i32>()?; Ok(fir...st_number * second_number) } fn print(result: Result<i32, ParseIntErr...ParseIntError; fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {... - https://man.plustar.jp/rust/example/error/result/enter_question_mark.html - [similar]
- Resultのmap - Rust By Example 日本語版 11873
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...なしで行います。 fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {...r_str.parse::<i32>() { Ok(first_number) => { match second_number_str.parse::<i32>() { Ok(second_number) => {...Ok(first_number * second_number) }, Err(e) => Err(e), } }, Err(e) => Err(e)...まま見送ります。 fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {... - https://man.plustar.jp/rust/example/error/result/result_map.html - [similar]
- 早期リターン - Rust By Example 日本語版 10981
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ParseIntError; fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {...) => first_number, Err(e) => return Err(e), }; let second_number = match second_number_str.parse::<i32>() {...Ok(second_number) => second_number, Err(e) => return Err(e),...}; Ok(first_number * second_number) } fn print(result: Result<i32, ParseIntErr... - https://man.plustar.jp/rust/example/error/result/early_returns.html - [similar]
- 圧縮 - Rust By Example 日本語版 10346
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...タイムに押し込める。 fn multiply<'a>(first: &'a i32, second: &'a i32) -> i32 { first * second } // `<'a: 'b, '...= 2; // Longer lifetime // 長いライフタイム { let second = 3; // Shorter lifetime // 短いライフタイム print...ln!("The product is {}", multiply(&first, &second)); println!("{} is the first", choose_first(&first..., &second)); }; } 関連キーワード: 圧縮 , 関数 , Result , ライ... - https://man.plustar.jp/rust/example/scope/lifetime/lifetime_coercion.html - [similar]
- Resultに対するエイリアス - Rust By Example 日本語版 9711
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ult`型)を使用 fn multiply(first_number_str: &str, second_number_str: &str) -> AliasedResult<i32> { first_nu...mber_str.parse::<i32>().and_then(|first_number| { second_number_str.parse::<i32>().map(|second_number| firs...t_number * second_number) }) } // Here, the alias again allows us to...ード: Result , 関数 , エラー , By , Example , Rust , second , 定義 , map , ParseIntError... - https://man.plustar.jp/rust/example/error/result/result_alias.html - [similar]
- 継承(Derive) - Rust By Example 日本語版 9591
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...= self; Centimeters(inches as f64 * 2.54) } } // `Seconds`, a tuple struct with no additional attributes //...`Seconds`には特にアトリビュートを付け加えない。 struct Sec...onds(i32); fn main() { let _one_second = Seconds(1); // Error: `Seconds` can't be printed...it doesn't implement the `Debug` trait // エラー: `Seconds`はプリントできない。これは`Debug`トレイトを実装し... - https://man.plustar.jp/rust/example/trait/derive.html - [similar]
- Result - Rust By Example 日本語版 8819
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...見てみましょう。 fn multiply(first_number_str: &str, second_number_str: &str) -> i32 { // Let's try using `unw...er = first_number_str.parse::<i32>().unwrap(); let second_number = second_number_str.parse::<i32>().unwrap()...; first_number * second_number } fn main() { let twenty = multiply("10", "... - https://man.plustar.jp/rust/example/error/result.html - [similar]
- メソッド - Rust By Example 日本語版 8699
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ure `self` // `self`をデストラクト let Pair(first, second) = self; println!("Destroying Pair({}, {})", first..., second); // `first` and `second` go out of scope and get...freed // `first`、`second`はスコープから抜け出すと同時に、解放される。 } } f... - https://man.plustar.jp/rust/example/fn/methods.html - [similar]
- Rust By Example 日本語版 7807
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...st value: {}", long_tuple.0); println!("long tuple second value: {}", long_tuple.1); // Tuples can be tuple...first element of the array: {}", xs[0]); println!("second element of the array: {}", xs[1]); // `len` return...のフィールドの値を用いて生成したためである println!("second point: ({}, {})", bottom_right.x, bottom_right.y);...usize や f32 のようなプリミティブ型です。 // `NanoSecond` is a new name for `u64`. // `NanoSecond` を `u64`... - https://man.plustar.jp/rust/example/print.html - [similar]
- 引数のパース - Rust By Example 日本語版 7807
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...() { Ok(n) => { n }, Err(_) => { eprintln!("error: second argument not an integer"); help(); return; }, }; /...is the answer! $ ./match_args do something error: second argument not an integer usage: match_args <string>... - https://man.plustar.jp/rust/example/std_misc/arg/matching.html - [similar]