{"action":"closed","number":1123,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123","id":35588565,"html_url":"https://github.com/rust-lang/rfcs/pull/1123","diff_url":"https://github.com/rust-lang/rfcs/pull/1123.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1123.patch","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1123","number":1123,"state":"closed","locked":false,"title":"RFC: introduce `split_at(mid: usize)` on `str`","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"body":"Introduce the method `split_at(&self, mid: usize) -> (&str, &str)` on `str`,\r\nto divide a slice into two, just like we can with `[T]`.\r\n\r\n[**Rendered version**](https://github.com/bluss/rfcs/blob/str-split-at/text/0000-str-split-at.md)\r\n\r\nAdding `split_at` is a measure to provide a method from `[T]` in a version that\r\nmakes sense for `str`.\r\n\r\nOnce used to `[T]`, users might even expect that `split_at` is present on str.\r\n\r\n```rust\r\n/// Divide one string slice into two at an index.\r\n///\r\n/// The index `mid` is a byte offset from the start of the string\r\n/// that must be on a character boundary.\r\n///\r\n/// Return slices `&self[..mid]` and `&self[mid..]`.\r\n///\r\n/// # Panics\r\n///\r\n/// Panics if `mid` is beyond the last character of the string,\r\n/// or if it is not on a character boundary.\r\n///\r\n/// # Examples\r\n/// ```\r\n/// let s = \"Löwe 老虎 Léopard\";\r\n/// let first_space = s.find(' ').unwrap_or(s.len());\r\n/// let (a, b) = s.split_at(first_space);\r\n///\r\n/// assert_eq!(a, \"Löwe\");\r\n/// assert_eq!(b, \" 老虎 Léopard\");\r\n/// ```\r\nfn split_at(&self, mid: usize) -> (&str, &str) {\r\n    (&self[..mid], &self[mid..])\r\n}\r\n```","created_at":"2015-05-17T15:22:06Z","updated_at":"2015-06-09T23:52:24Z","closed_at":"2015-06-09T23:52:24Z","merged_at":"2015-06-09T23:52:24Z","merge_commit_sha":"b2b660cd74ed27eeb14d981d7fc0a5e9ea3f77b0","assignee":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1123/comments","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/8f8f7ea7ebc3890e1d8541f34f59ec15177311a8","head":{"label":"bluss:str-split-at","ref":"str-split-at","sha":"8f8f7ea7ebc3890e1d8541f34f59ec15177311a8","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"repo":{"id":29616688,"name":"rfcs","full_name":"bluss/rfcs","owner":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bluss/rfcs","description":"RFCs for changes to Rust","fork":true,"url":"https://api.github.com/repos/bluss/rfcs","forks_url":"https://api.github.com/repos/bluss/rfcs/forks","keys_url":"https://api.github.com/repos/bluss/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluss/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluss/rfcs/teams","hooks_url":"https://api.github.com/repos/bluss/rfcs/hooks","issue_events_url":"https://api.github.com/repos/bluss/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/bluss/rfcs/events","assignees_url":"https://api.github.com/repos/bluss/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/bluss/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/bluss/rfcs/tags","blobs_url":"https://api.github.com/repos/bluss/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluss/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluss/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluss/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluss/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/bluss/rfcs/languages","stargazers_url":"https://api.github.com/repos/bluss/rfcs/stargazers","contributors_url":"https://api.github.com/repos/bluss/rfcs/contributors","subscribers_url":"https://api.github.com/repos/bluss/rfcs/subscribers","subscription_url":"https://api.github.com/repos/bluss/rfcs/subscription","commits_url":"https://api.github.com/repos/bluss/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluss/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluss/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluss/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluss/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/bluss/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluss/rfcs/merges","archive_url":"https://api.github.com/repos/bluss/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluss/rfcs/downloads","issues_url":"https://api.github.com/repos/bluss/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/bluss/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/bluss/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/bluss/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluss/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/bluss/rfcs/releases{/id}","created_at":"2015-01-21T21:29:10Z","updated_at":"2015-01-21T20:30:35Z","pushed_at":"2015-05-20T01:10:22Z","git_url":"git://github.com/bluss/rfcs.git","ssh_url":"git@github.com:bluss/rfcs.git","clone_url":"https://github.com/bluss/rfcs.git","svn_url":"https://github.com/bluss/rfcs","homepage":"","size":1867,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"64ccd298cdab77ab10cf35c76d0480ec486b83b5","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17527989,"name":"rfcs","full_name":"rust-lang/rfcs","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rfcs","description":"RFCs for changes to Rust","fork":false,"url":"https://api.github.com/repos/rust-lang/rfcs","forks_url":"https://api.github.com/repos/rust-lang/rfcs/forks","keys_url":"https://api.github.com/repos/rust-lang/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rfcs/teams","hooks_url":"https://api.github.com/repos/rust-lang/rfcs/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rfcs/events","assignees_url":"https://api.github.com/repos/rust-lang/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rfcs/tags","blobs_url":"https://api.github.com/repos/rust-lang/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rfcs/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rfcs/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rfcs/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rfcs/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rfcs/subscription","commits_url":"https://api.github.com/repos/rust-lang/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rfcs/merges","archive_url":"https://api.github.com/repos/rust-lang/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rfcs/downloads","issues_url":"https://api.github.com/repos/rust-lang/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rfcs/releases{/id}","created_at":"2014-03-07T21:29:00Z","updated_at":"2015-06-08T15:42:34Z","pushed_at":"2015-06-09T23:52:22Z","git_url":"git://github.com/rust-lang/rfcs.git","ssh_url":"git@github.com:rust-lang/rfcs.git","clone_url":"https://github.com/rust-lang/rfcs.git","svn_url":"https://github.com/rust-lang/rfcs","homepage":"","size":10424,"stargazers_count":380,"watchers_count":380,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":206,"mirror_url":null,"open_issues_count":517,"forks":206,"open_issues":517,"watchers":380,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/1123"},"issue":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1123"},"comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1123/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1123/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rfcs/statuses/8f8f7ea7ebc3890e1d8541f34f59ec15177311a8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":24,"review_comments":0,"commits":2,"additions":102,"deletions":0,"changed_files":1}}