{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/19395","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/19395/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/19395/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/19395/events","html_url":"https://github.com/rust-lang/rust/issues/19395","id":50418468,"number":19395,"title":"`ExactSizeIterator` should not require `DoubleEndedIterator`; move `rposition` to extension trait","user":{"login":"DanielKeep","id":77238,"avatar_url":"https://avatars.githubusercontent.com/u/77238?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielKeep","html_url":"https://github.com/DanielKeep","followers_url":"https://api.github.com/users/DanielKeep/followers","following_url":"https://api.github.com/users/DanielKeep/following{/other_user}","gists_url":"https://api.github.com/users/DanielKeep/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielKeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielKeep/subscriptions","organizations_url":"https://api.github.com/users/DanielKeep/orgs","repos_url":"https://api.github.com/users/DanielKeep/repos","events_url":"https://api.github.com/users/DanielKeep/events{/privacy}","received_events_url":"https://api.github.com/users/DanielKeep/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-iterators","name":"A-iterators","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-29T07:38:25Z","updated_at":"2015-05-26T18:42:52Z","closed_at":"2015-05-26T18:42:52Z","body":"I have an iterator extension which performs an incremental calculation, yielding partial results along the way (technically a specialisation of scan).\r\n\r\nI can easily implement `ExactSizeIterator::len`, provided the underlying iterator *also* implements it, but I *cannot* implement `DoubleEndedIterator` because that would require computing and caching all intermediate results.\r\n\r\nI'm really not sure why `rposition` is even *part* of `ExactSizeIterator`; surely it should be an extension trait that requires both?  Currently, it's presence prohibits implementing the `len` method which is the only part of `ExactSize` that might reasonably be expected to be there."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/105630671","html_url":"https://github.com/rust-lang/rust/issues/19395#issuecomment-105630671","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/19395","id":105630671,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","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":"2015-05-26T18:42:52Z","updated_at":"2015-05-26T18:42:52Z","body":"yay!"}}