{"action":"created","issue":{"url":"https://api.github.com/repos/bluss/arrayvec/issues/9","labels_url":"https://api.github.com/repos/bluss/arrayvec/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/bluss/arrayvec/issues/9/comments","events_url":"https://api.github.com/repos/bluss/arrayvec/issues/9/events","html_url":"https://github.com/bluss/arrayvec/issues/9","id":104449617,"number":9,"title":"Consider replicating the `Vec` interface more closely","user":{"login":"tbu-","id":6666593,"avatar_url":"https://avatars.githubusercontent.com/u/6666593?v=3","gravatar_id":"","url":"https://api.github.com/users/tbu-","html_url":"https://github.com/tbu-","followers_url":"https://api.github.com/users/tbu-/followers","following_url":"https://api.github.com/users/tbu-/following{/other_user}","gists_url":"https://api.github.com/users/tbu-/gists{/gist_id}","starred_url":"https://api.github.com/users/tbu-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbu-/subscriptions","organizations_url":"https://api.github.com/users/tbu-/orgs","repos_url":"https://api.github.com/users/tbu-/repos","events_url":"https://api.github.com/users/tbu-/events{/privacy}","received_events_url":"https://api.github.com/users/tbu-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-02T10:31:22Z","updated_at":"2015-09-17T22:42:08Z","closed_at":null,"body":"I'm specifically talking about the `remove` and `swap_remove` methods, they both return `T` in `Vec` (panic if out of bounds), whereas this one returns `Some(T)` and `None` if out of bounds.\r\n\r\nAnother nit is that `push` returns an `Option` instead of a `Result`, so you can't use `try!` together with that. My suggestion would be to return an `Result<(),ArrayVecFull<T>>`, with an `into_inner` method for `ArrayVecFull<T>`.\r\n\r\nI'd prepare a pull request if you'd like these changes."},"comment":{"url":"https://api.github.com/repos/bluss/arrayvec/issues/comments/141257717","html_url":"https://github.com/bluss/arrayvec/issues/9#issuecomment-141257717","issue_url":"https://api.github.com/repos/bluss/arrayvec/issues/9","id":141257717,"user":{"login":"tbu-","id":6666593,"avatar_url":"https://avatars.githubusercontent.com/u/6666593?v=3","gravatar_id":"","url":"https://api.github.com/users/tbu-","html_url":"https://github.com/tbu-","followers_url":"https://api.github.com/users/tbu-/followers","following_url":"https://api.github.com/users/tbu-/following{/other_user}","gists_url":"https://api.github.com/users/tbu-/gists{/gist_id}","starred_url":"https://api.github.com/users/tbu-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbu-/subscriptions","organizations_url":"https://api.github.com/users/tbu-/orgs","repos_url":"https://api.github.com/users/tbu-/repos","events_url":"https://api.github.com/users/tbu-/events{/privacy}","received_events_url":"https://api.github.com/users/tbu-/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T22:42:08Z","updated_at":"2015-09-17T22:42:08Z","body":"You're right, in my opinion, capacity-related errors should `Result`s.\r\n\r\nThe other part of this issue was that `arrayvec` modifies the semantics of `remove` and `swap_remove` – the standard library's `Vec` considers out-of-range indices a programmer error (and panics) and `arrayvec` treats these out-of-range errors as part of the normal program flow (and uses `Option`)."}}