{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rustc-serialize/issues/68","labels_url":"https://api.github.com/repos/rust-lang/rustc-serialize/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rustc-serialize/issues/68/comments","events_url":"https://api.github.com/repos/rust-lang/rustc-serialize/issues/68/events","html_url":"https://github.com/rust-lang/rustc-serialize/issues/68","id":59240585,"number":68,"title":"Decoder::read_seq requires infinite lookahead","user":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars.githubusercontent.com/u/332036?v=3","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-27T14:12:10Z","updated_at":"2015-02-27T14:12:10Z","closed_at":null,"body":"Implementing Decoder for a representation that does not know the length of sequences ahead of time requires infinite lookahead, since the length needs to be known before the first element is parsed.\r\n\r\nFor example: if Json were not parsed to the Json enum as an intermediate, when a sequence is expected, the `read_seq` function would need to parse ahead until it finds the corresponding `]`.\r\n\r\nAlso, all the collection implementations in `collection_impls.rs` do not require the length to be known beforehand. They only use it as an optimization to reduce the number of allocations."}}