![](https://cdn-ak-scissors.b.st-hatena.com/image/square/bfad4526d45ad1d64a2248656a5af78a8b99a933/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--L24SfH6t--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3AScala%2525203%252520boundary%25252Fbreak%252520%2525E3%252581%2525A7%252520optional%252520chaining%252520%2525E3%252581%2525A8%252520error%252520short%252520...%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3A110416%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyL2I5NmI4ODllNWIuanBlZw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)
エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Scala 3 boundary/break で optional chaining と error short circuit
また、Rust ではResult で失敗する関数や Option で None になる処理に ? をつけることで処理を short-c... また、Rust ではResult で失敗する関数や Option で None になる処理に ? をつけることで処理を short-circuit して抜け出せる. これは TypeScript や Kotlin の optional chaining を Result 型にも拡張したものとしてみることができる. Rust: Result の short-circuit pub fn f() -> Result<i32,String> { let str = may_fail_with_string()?; let i = str.parse::<i32>().map_err(|_| "error message".to_string())?; Ok(i) } fn may_fail_with_string() -> Result<String,String> { todo!() }
2023/12/07 リンク