{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/51339","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/51339/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/51339/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/51339/events","html_url":"https://github.com/rust-lang/rust/pull/51339","id":328944554,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMzIzOTYz","number":51339,"title":"Add ExactChunks::remainder and ExactChunks::into_remainder","user":{"login":"sdroege","id":301846,"node_id":"MDQ6VXNlcjMwMTg0Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/301846?v=4","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"labels":[{"id":583437099,"node_id":"MDU6TGFiZWw1ODM0MzcwOTk=","url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-team","name":"S-waiting-on-team","color":"d3dddd","default":false},{"id":211668062,"node_id":"MDU6TGFiZWwyMTE2NjgwNjI=","url":"https://api.github.com/repos/rust-lang/rust/labels/T-libs","name":"T-libs","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-06-04T07:50:26Z","updated_at":"2018-07-12T18:02:23Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/51339","html_url":"https://github.com/rust-lang/rust/pull/51339","diff_url":"https://github.com/rust-lang/rust/pull/51339.diff","patch_url":"https://github.com/rust-lang/rust/pull/51339.patch"},"body":"These allow to get the leftover items of the slice that are not being\r\niterated as part of the iterator due to not filling a complete chunk.\r\n\r\nThe mutable version consumes the slice because otherwise we would either\r\na) have to borrow the iterator instead of taking the lifetime of\r\nthe underlying slice, which is not what *any* of the other iterator\r\nfunctions is doing, or\r\nb) would allow returning multiple mutable references to the same data\r\n\r\nThe current behaviour of consuming the iterator is consistent with\r\nIterMut::into_slice for the normal iterator.\r\n\r\n----\r\n\r\nThis is related to https://github.com/rust-lang/rust/issues/47115#issuecomment-392685177 and the following comments.\r\n\r\nWhile there the discussion was first about a way to get the \"tail\" of the iterator (everything from the slice that is still not iterated yet), this gives kind of unintuitive behaviour and is inconsistent with how the other slice iterators work.\r\n\r\nUnintuitive because the `next_back` would have no effect on the tail (or otherwise the tail could not include the remainder items), inconsistent because a) generally the idea of the slice iterators seems to be to only ever return items that were not iterated yet (and don't provide a way to access the same item twice) and b) we would return a \"flat\" `&[T]` slice but the iterator's shape is `&[[T]]` instead, c) the mutable variant would have to borrow from the iterator instead of the underlying slice (all other iterator functions borrow from the underlying slice!)\r\n\r\nAs such, I've only implemented functions to get the remainder. This also allows the implementation to be completely safe still (and around slices instead of raw pointers), while getting the tail would either be inefficient or would have to be implemented around raw pointers.\r\n\r\nCC @kerollmops"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/404598980","html_url":"https://github.com/rust-lang/rust/pull/51339#issuecomment-404598980","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/51339","id":404598980,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDU5ODk4MA==","user":{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T18:02:23Z","updated_at":"2018-07-12T18:02:23Z","author_association":"MEMBER","body":"Egad sorry for the delay!\r\n\r\n@bors: r+"}}
{"actor":{"display_login":"alexcrichton"}}