{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/36712","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/36712/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/36712/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/36712/events","html_url":"https://github.com/rust-lang/rust/issues/36712","id":179068607,"node_id":"MDU6SXNzdWUxNzkwNjg2MDc=","number":36712,"title":"Add a shift method to Vec","user":{"login":"watzon","id":4535422,"node_id":"MDQ6VXNlcjQ1MzU0MjI=","avatar_url":"https://avatars0.githubusercontent.com/u/4535422?v=4","gravatar_id":"","url":"https://api.github.com/users/watzon","html_url":"https://github.com/watzon","followers_url":"https://api.github.com/users/watzon/followers","following_url":"https://api.github.com/users/watzon/following{/other_user}","gists_url":"https://api.github.com/users/watzon/gists{/gist_id}","starred_url":"https://api.github.com/users/watzon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watzon/subscriptions","organizations_url":"https://api.github.com/users/watzon/orgs","repos_url":"https://api.github.com/users/watzon/repos","events_url":"https://api.github.com/users/watzon/events{/privacy}","received_events_url":"https://api.github.com/users/watzon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-25T05:08:57Z","updated_at":"2018-07-23T15:16:31Z","closed_at":"2016-09-25T15:27:52Z","author_association":"NONE","body":"Vec has a `pop` method which is great for removing and returning the last element in a Vec, however it ends up being complicated if you want to do the same with the first element.  I propose adding a `shift` method to do just that. It could be implemented as follows:\n\n``` rust\npub fn shift(&mut self) -> Option<T> {\n        if self.len == 0 {\n            None\n        } else {\n            unsafe {\n                self.len -= 1;\n                Some(ptr::read(self.get_unchecked(0)))\n            }\n        }\n    }\n```\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/407094455","html_url":"https://github.com/rust-lang/rust/issues/36712#issuecomment-407094455","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/36712","id":407094455,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzA5NDQ1NQ==","user":{"login":"Fedcomp","id":977989,"node_id":"MDQ6VXNlcjk3Nzk4OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/977989?v=4","gravatar_id":"","url":"https://api.github.com/users/Fedcomp","html_url":"https://github.com/Fedcomp","followers_url":"https://api.github.com/users/Fedcomp/followers","following_url":"https://api.github.com/users/Fedcomp/following{/other_user}","gists_url":"https://api.github.com/users/Fedcomp/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedcomp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedcomp/subscriptions","organizations_url":"https://api.github.com/users/Fedcomp/orgs","repos_url":"https://api.github.com/users/Fedcomp/repos","events_url":"https://api.github.com/users/Fedcomp/events{/privacy}","received_events_url":"https://api.github.com/users/Fedcomp/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T15:16:31Z","updated_at":"2018-07-23T15:16:31Z","author_association":"NONE","body":".remove requires additional boilerplate, wish it was Option. Surprised there is still no shift method."}}
{"actor":{"display_login":"Fedcomp"}}