{"published":"2016-10-19 09:02:06","categories":["rust"],"provider_name":"Hatena Blog","width":"100%","version":"1.0","url":"https://totem3.hatenablog.jp/entry/2016/10/19/090206","blog_title":"\u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3059\u3088\uff01","provider_url":"https://hatena.blog","description":"Option \u3092\u6301\u3064\u69cb\u9020\u4f53\u3092\u6271\u3063\u3066\u3044\u308b\u3068\u304d\u306a\u3069\u306b\u3001Option \u306e\u5024\u3092\u53d6\u5f97\u3057\u3066\u305d\u306e\u5f8c None \u3067\u7f6e\u304d\u63db\u3048\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u3002 \u305d\u3093\u306a\u3068\u304d\u306f take \u30e1\u30bd\u30c3\u30c9 \u304c\u4f7f\u3048\u308b\u3002 Rust Playground fn main() { let mut x = Some(10); // Some(v) \u306b\u5bfe\u3057\u3066\u547c\u3073\u51fa\u3059\u3068 Some(v) \u304c\u8fd4\u3063\u3066\u304f\u308b assert_eq!(x.take(), Some(10)); // x \u306f None \u306b\u306a\u3063\u3066\u308b assert_eq!(x, None); // None \u306b\u5bfe\u3057\u3066\u547c\u3073\u51fa\u3059\u3068 None \u304c\u8fd4\u3063\u3066\u304f\u308b assert_eq!(x.take(), None); \u2026","author_url":"https://blog.hatena.ne.jp/totem_3/","type":"rich","author_name":"totem_3","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftotem3.hatenablog.jp%2Fentry%2F2016%2F10%2F19%2F090206\" title=\" Rust \u30e1\u30e2 Option | \u5024\u3092\u53d6\u5f97\u3057\u3066 None \u3067\u7f6e\u304d\u63db\u3048\u308b - \u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3059\u3088\uff01\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"height":"190","title":" Rust \u30e1\u30e2 Option | \u5024\u3092\u53d6\u5f97\u3057\u3066 None \u3067\u7f6e\u304d\u63db\u3048\u308b","blog_url":"https://totem3.hatenablog.jp/"}