{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/58135937","id":58135937,"diff_hunk":"@@ -591,19 +591,26 @@ defmodule String do\n   defdelegate rstrip(binary), to: String.Break\n \n   @doc \"\"\"\n-  Returns a string where all trailing `char`s have been removed.\n+  Returns a string where all trailing `to_strip`s have been removed.\n \n   ## Examples\n \n       iex> String.rstrip(\"   abc _\", ?_)\n       \"   abc \"\n \n+      iex> String.rstrip(\"ab abc ab\", \"ab\")\n+      \"ab abc \"\n+\n   \"\"\"\n-  @spec rstrip(t, char) :: t\n+  @spec rstrip(t, char | binary) :: t\n   def rstrip(string, char) when is_integer(char) do","path":"lib/elixir/lib/string.ex","position":18,"original_position":18,"commit_id":"3ba6d54f73e962acea079a2177b9273af56bfb9d","original_commit_id":"3ba6d54f73e962acea079a2177b9273af56bfb9d","user":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"body":"Since we have two clauses, it would probably be better to have a bodyless so that the argument names are taken from that:\r\n\r\n```elixir\r\n@spec ...\r\ndef rstrip(string, to_strip)\r\n\r\ndef rstrip(string, char) when is_integer(char) do\r\n...\r\n```\r\n\r\nThe way it is now, the documentation will show the function as `rstrip(string, char)` but you mention `to_strip` in the documentation.","created_at":"2016-03-31T22:07:52Z","updated_at":"2016-03-31T22:07:52Z","html_url":"https://github.com/elixir-lang/elixir/pull/4462#discussion_r58135937","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/58135937"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4462#discussion_r58135937"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462","id":64859814,"html_url":"https://github.com/elixir-lang/elixir/pull/4462","diff_url":"https://github.com/elixir-lang/elixir/pull/4462.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/4462.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4462","number":4462,"state":"open","locked":false,"title":"Allow binary second arg to String.{l,r}strip","user":{"login":"lpil","id":6134406,"avatar_url":"https://avatars.githubusercontent.com/u/6134406?v=3","gravatar_id":"","url":"https://api.github.com/users/lpil","html_url":"https://github.com/lpil","followers_url":"https://api.github.com/users/lpil/followers","following_url":"https://api.github.com/users/lpil/following{/other_user}","gists_url":"https://api.github.com/users/lpil/gists{/gist_id}","starred_url":"https://api.github.com/users/lpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpil/subscriptions","organizations_url":"https://api.github.com/users/lpil/orgs","repos_url":"https://api.github.com/users/lpil/repos","events_url":"https://api.github.com/users/lpil/events{/privacy}","received_events_url":"https://api.github.com/users/lpil/received_events","type":"User","site_admin":false},"body":"Related to https://github.com/elixir-lang/elixir/issues/4433\r\n\r\nNot entirely sure I got the typespecs correct.","created_at":"2016-03-31T21:13:17Z","updated_at":"2016-03-31T22:07:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10f163e04995db1c8a1ac1be3d30097cd30cccb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4462/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/3ba6d54f73e962acea079a2177b9273af56bfb9d","head":{"label":"lpil:string-strip-graphemes","ref":"string-strip-graphemes","sha":"3ba6d54f73e962acea079a2177b9273af56bfb9d","user":{"login":"lpil","id":6134406,"avatar_url":"https://avatars.githubusercontent.com/u/6134406?v=3","gravatar_id":"","url":"https://api.github.com/users/lpil","html_url":"https://github.com/lpil","followers_url":"https://api.github.com/users/lpil/followers","following_url":"https://api.github.com/users/lpil/following{/other_user}","gists_url":"https://api.github.com/users/lpil/gists{/gist_id}","starred_url":"https://api.github.com/users/lpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpil/subscriptions","organizations_url":"https://api.github.com/users/lpil/orgs","repos_url":"https://api.github.com/users/lpil/repos","events_url":"https://api.github.com/users/lpil/events{/privacy}","received_events_url":"https://api.github.com/users/lpil/received_events","type":"User","site_admin":false},"repo":{"id":34217530,"name":"elixir","full_name":"lpil/elixir","owner":{"login":"lpil","id":6134406,"avatar_url":"https://avatars.githubusercontent.com/u/6134406?v=3","gravatar_id":"","url":"https://api.github.com/users/lpil","html_url":"https://github.com/lpil","followers_url":"https://api.github.com/users/lpil/followers","following_url":"https://api.github.com/users/lpil/following{/other_user}","gists_url":"https://api.github.com/users/lpil/gists{/gist_id}","starred_url":"https://api.github.com/users/lpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpil/subscriptions","organizations_url":"https://api.github.com/users/lpil/orgs","repos_url":"https://api.github.com/users/lpil/repos","events_url":"https://api.github.com/users/lpil/events{/privacy}","received_events_url":"https://api.github.com/users/lpil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lpil/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":true,"url":"https://api.github.com/repos/lpil/elixir","forks_url":"https://api.github.com/repos/lpil/elixir/forks","keys_url":"https://api.github.com/repos/lpil/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lpil/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lpil/elixir/teams","hooks_url":"https://api.github.com/repos/lpil/elixir/hooks","issue_events_url":"https://api.github.com/repos/lpil/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/lpil/elixir/events","assignees_url":"https://api.github.com/repos/lpil/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/lpil/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/lpil/elixir/tags","blobs_url":"https://api.github.com/repos/lpil/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lpil/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lpil/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/lpil/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lpil/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/lpil/elixir/languages","stargazers_url":"https://api.github.com/repos/lpil/elixir/stargazers","contributors_url":"https://api.github.com/repos/lpil/elixir/contributors","subscribers_url":"https://api.github.com/repos/lpil/elixir/subscribers","subscription_url":"https://api.github.com/repos/lpil/elixir/subscription","commits_url":"https://api.github.com/repos/lpil/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/lpil/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/lpil/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/lpil/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/lpil/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/lpil/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lpil/elixir/merges","archive_url":"https://api.github.com/repos/lpil/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lpil/elixir/downloads","issues_url":"https://api.github.com/repos/lpil/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/lpil/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/lpil/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/lpil/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lpil/elixir/labels{/name}","releases_url":"https://api.github.com/repos/lpil/elixir/releases{/id}","deployments_url":"https://api.github.com/repos/lpil/elixir/deployments","created_at":"2015-04-19T17:59:15Z","updated_at":"2016-03-31T15:34:48Z","pushed_at":"2016-03-31T22:03:06Z","git_url":"git://github.com/lpil/elixir.git","ssh_url":"git@github.com:lpil/elixir.git","clone_url":"https://github.com/lpil/elixir.git","svn_url":"https://github.com/lpil/elixir","homepage":"http://elixir-lang.org/","size":34050,"stargazers_count":0,"watchers_count":0,"language":"Elixir","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":"elixir-lang:master","ref":"master","sha":"a0798b70f394bf8dbbd232a81cb745a3e0cfc9a7","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","deployments_url":"https://api.github.com/repos/elixir-lang/elixir/deployments","created_at":"2011-01-09T08:43:57Z","updated_at":"2016-03-31T20:12:10Z","pushed_at":"2016-03-31T22:03:07Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":42357,"stargazers_count":6616,"watchers_count":6616,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":895,"mirror_url":null,"open_issues_count":44,"forks":895,"open_issues":44,"watchers":6616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4462"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4462"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4462/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4462/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/3ba6d54f73e962acea079a2177b9273af56bfb9d"}}}}