{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/2296","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2296/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2296/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2296/events","html_url":"https://github.com/rust-lang/rfcs/pull/2296","id":289076256,"node_id":"MDExOlB1bGxSZXF1ZXN0MTYzMzAyNDM5","number":2296,"title":"RFC: Add `Option::replace` to the core library","user":{"login":"Kerollmops","id":3610253,"node_id":"MDQ6VXNlcjM2MTAyNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/3610253?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerollmops","html_url":"https://github.com/Kerollmops","followers_url":"https://api.github.com/users/Kerollmops/followers","following_url":"https://api.github.com/users/Kerollmops/following{/other_user}","gists_url":"https://api.github.com/users/Kerollmops/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerollmops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerollmops/subscriptions","organizations_url":"https://api.github.com/users/Kerollmops/orgs","repos_url":"https://api.github.com/users/Kerollmops/repos","events_url":"https://api.github.com/users/Kerollmops/events{/privacy}","received_events_url":"https://api.github.com/users/Kerollmops/received_events","type":"User","site_admin":false},"labels":[{"id":211667901,"node_id":"MDU6TGFiZWwyMTE2Njc5MDE=","url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-libs","name":"T-libs","color":"bfd4f2","default":false},{"id":921950520,"node_id":"MDU6TGFiZWw5MjE5NTA1MjA=","url":"https://api.github.com/repos/rust-lang/rfcs/labels/disposition-merge","name":"disposition-merge","color":"008800","default":false},{"id":216585564,"node_id":"MDU6TGFiZWwyMTY1ODU1NjQ=","url":"https://api.github.com/repos/rust-lang/rfcs/labels/final-comment-period","name":"final-comment-period","color":"1e76d9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2018-01-16T22:21:21Z","updated_at":"2018-06-27T11:34:15Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/2296","html_url":"https://github.com/rust-lang/rfcs/pull/2296","diff_url":"https://github.com/rust-lang/rfcs/pull/2296.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/2296.patch"},"body":"Add the method `Option::replace` to the core library. This method makes possible to easily replace the value of an option to some value (`Some(value)`).\r\n\r\n[Rendered](https://github.com/Kerollmops/rfcs-1/blob/master/text/0000-option-replace.md)\r\n\r\n```rust\r\nlet mut x = Some(2);\r\nlet old = x.replace(5);\r\nassert_eq!(x, Some(5));\r\nassert_eq!(old, Some(2));\r\n\r\nlet mut x = None;\r\nlet old = x.replace(3);\r\nassert_eq!(x, Some(3));\r\nassert_eq!(old, None);\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/400640833","html_url":"https://github.com/rust-lang/rfcs/pull/2296#issuecomment-400640833","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2296","id":400640833,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDY0MDgzMw==","user":{"login":"Kerollmops","id":3610253,"node_id":"MDQ6VXNlcjM2MTAyNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/3610253?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerollmops","html_url":"https://github.com/Kerollmops","followers_url":"https://api.github.com/users/Kerollmops/followers","following_url":"https://api.github.com/users/Kerollmops/following{/other_user}","gists_url":"https://api.github.com/users/Kerollmops/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerollmops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerollmops/subscriptions","organizations_url":"https://api.github.com/users/Kerollmops/orgs","repos_url":"https://api.github.com/users/Kerollmops/repos","events_url":"https://api.github.com/users/Kerollmops/events{/privacy}","received_events_url":"https://api.github.com/users/Kerollmops/received_events","type":"User","site_admin":false},"created_at":"2018-06-27T11:34:15Z","updated_at":"2018-06-27T11:34:15Z","author_association":"NONE","body":"I add faced some cases where this method could have been useful.\r\n\r\n```rust\r\n```"}}
{"actor":{"display_login":"Kerollmops"}}