{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments/227626966","pull_request_review_id":167711381,"id":227626966,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzYyNjk2Ng==","diff_hunk":"@@ -334,41 +318,48 @@ fn add_targets(target_paths: &[cargo_metadata::Target], targets: &mut HashSet<Ta\n }\n \n fn run_rustfmt(\n-    files: &[PathBuf],\n+    targets: &HashSet<Target>,\n     fmt_args: &[String],\n     verbosity: Verbosity,\n-) -> Result<ExitStatus, io::Error> {\n-    let stdout = if verbosity == Verbosity::Quiet {\n-        std::process::Stdio::null()\n-    } else {\n-        std::process::Stdio::inherit()\n-    };\n+) -> Result<i32, io::Error> {\n+    let by_edition: HashMap<_, _> = targets\n+        .iter()\n+        .inspect(|t| {\n+            if verbosity == Verbosity::Verbose {\n+                println!(\"[{} ({})] {:?}\", t.kind, t.edition, t.path)\n+            }\n+        })\n+        .map(|t| (&t.edition, vec![&t.path]))\n+        .collect();\n \n-    if verbosity == Verbosity::Verbose {\n-        print!(\"rustfmt\");\n-        for a in fmt_args {\n-            print!(\" {}\", a);\n-        }\n-        for f in files {\n-            print!(\" {}\", f.display());","path":"src/cargo-fmt/main.rs","position":120,"original_position":120,"commit_id":"bd19e0ba423b44140fe389a51063552ed14123bb","original_commit_id":"bd19e0ba423b44140fe389a51063552ed14123bb","user":{"login":"nrc","id":762626,"node_id":"MDQ6VXNlcjc2MjYyNg==","avatar_url":"https://avatars0.githubusercontent.com/u/762626?v=4","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"body":"I think we should keep this stuff.","created_at":"2018-10-24T02:43:56Z","updated_at":"2018-10-24T02:44:37Z","html_url":"https://github.com/rust-lang-nursery/rustfmt/pull/3129#discussion_r227626966","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments/227626966"},"html":{"href":"https://github.com/rust-lang-nursery/rustfmt/pull/3129#discussion_r227626966"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129","id":224874275,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0ODc0Mjc1","html_url":"https://github.com/rust-lang-nursery/rustfmt/pull/3129","diff_url":"https://github.com/rust-lang-nursery/rustfmt/pull/3129.diff","patch_url":"https://github.com/rust-lang-nursery/rustfmt/pull/3129.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/3129","number":3129,"state":"open","locked":false,"title":"cargo-fmt: detect Rust edition in use","user":{"login":"otavio","id":25278,"node_id":"MDQ6VXNlcjI1Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/25278?v=4","gravatar_id":"","url":"https://api.github.com/users/otavio","html_url":"https://github.com/otavio","followers_url":"https://api.github.com/users/otavio/followers","following_url":"https://api.github.com/users/otavio/following{/other_user}","gists_url":"https://api.github.com/users/otavio/gists{/gist_id}","starred_url":"https://api.github.com/users/otavio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavio/subscriptions","organizations_url":"https://api.github.com/users/otavio/orgs","repos_url":"https://api.github.com/users/otavio/repos","events_url":"https://api.github.com/users/otavio/events{/privacy}","received_events_url":"https://api.github.com/users/otavio/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-23T02:29:59Z","updated_at":"2018-10-24T02:44:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5b766e5505d879b94ffb9fe298696baf17aa4c3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/3129/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/bd19e0ba423b44140fe389a51063552ed14123bb","head":{"label":"otavio:issue-3104","ref":"issue-3104","sha":"bd19e0ba423b44140fe389a51063552ed14123bb","user":{"login":"otavio","id":25278,"node_id":"MDQ6VXNlcjI1Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/25278?v=4","gravatar_id":"","url":"https://api.github.com/users/otavio","html_url":"https://github.com/otavio","followers_url":"https://api.github.com/users/otavio/followers","following_url":"https://api.github.com/users/otavio/following{/other_user}","gists_url":"https://api.github.com/users/otavio/gists{/gist_id}","starred_url":"https://api.github.com/users/otavio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavio/subscriptions","organizations_url":"https://api.github.com/users/otavio/orgs","repos_url":"https://api.github.com/users/otavio/repos","events_url":"https://api.github.com/users/otavio/events{/privacy}","received_events_url":"https://api.github.com/users/otavio/received_events","type":"User","site_admin":false},"repo":{"id":150741087,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA3NDEwODc=","name":"rustfmt","full_name":"otavio/rustfmt","private":false,"owner":{"login":"otavio","id":25278,"node_id":"MDQ6VXNlcjI1Mjc4","avatar_url":"https://avatars0.githubusercontent.com/u/25278?v=4","gravatar_id":"","url":"https://api.github.com/users/otavio","html_url":"https://github.com/otavio","followers_url":"https://api.github.com/users/otavio/followers","following_url":"https://api.github.com/users/otavio/following{/other_user}","gists_url":"https://api.github.com/users/otavio/gists{/gist_id}","starred_url":"https://api.github.com/users/otavio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otavio/subscriptions","organizations_url":"https://api.github.com/users/otavio/orgs","repos_url":"https://api.github.com/users/otavio/repos","events_url":"https://api.github.com/users/otavio/events{/privacy}","received_events_url":"https://api.github.com/users/otavio/received_events","type":"User","site_admin":false},"html_url":"https://github.com/otavio/rustfmt","description":"Format Rust code","fork":true,"url":"https://api.github.com/repos/otavio/rustfmt","forks_url":"https://api.github.com/repos/otavio/rustfmt/forks","keys_url":"https://api.github.com/repos/otavio/rustfmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otavio/rustfmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otavio/rustfmt/teams","hooks_url":"https://api.github.com/repos/otavio/rustfmt/hooks","issue_events_url":"https://api.github.com/repos/otavio/rustfmt/issues/events{/number}","events_url":"https://api.github.com/repos/otavio/rustfmt/events","assignees_url":"https://api.github.com/repos/otavio/rustfmt/assignees{/user}","branches_url":"https://api.github.com/repos/otavio/rustfmt/branches{/branch}","tags_url":"https://api.github.com/repos/otavio/rustfmt/tags","blobs_url":"https://api.github.com/repos/otavio/rustfmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otavio/rustfmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otavio/rustfmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/otavio/rustfmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otavio/rustfmt/statuses/{sha}","languages_url":"https://api.github.com/repos/otavio/rustfmt/languages","stargazers_url":"https://api.github.com/repos/otavio/rustfmt/stargazers","contributors_url":"https://api.github.com/repos/otavio/rustfmt/contributors","subscribers_url":"https://api.github.com/repos/otavio/rustfmt/subscribers","subscription_url":"https://api.github.com/repos/otavio/rustfmt/subscription","commits_url":"https://api.github.com/repos/otavio/rustfmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/otavio/rustfmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/otavio/rustfmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/otavio/rustfmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/otavio/rustfmt/contents/{+path}","compare_url":"https://api.github.com/repos/otavio/rustfmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otavio/rustfmt/merges","archive_url":"https://api.github.com/repos/otavio/rustfmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otavio/rustfmt/downloads","issues_url":"https://api.github.com/repos/otavio/rustfmt/issues{/number}","pulls_url":"https://api.github.com/repos/otavio/rustfmt/pulls{/number}","milestones_url":"https://api.github.com/repos/otavio/rustfmt/milestones{/number}","notifications_url":"https://api.github.com/repos/otavio/rustfmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otavio/rustfmt/labels{/name}","releases_url":"https://api.github.com/repos/otavio/rustfmt/releases{/id}","deployments_url":"https://api.github.com/repos/otavio/rustfmt/deployments","created_at":"2018-09-28T12:59:52Z","updated_at":"2018-10-23T04:47:47Z","pushed_at":"2018-10-23T05:34:05Z","git_url":"git://github.com/otavio/rustfmt.git","ssh_url":"git@github.com:otavio/rustfmt.git","clone_url":"https://github.com/otavio/rustfmt.git","svn_url":"https://github.com/otavio/rustfmt","homepage":null,"size":8410,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"fa3cadf62c11cd8163f08029026a8475ad2b60fd","user":{"login":"rust-lang-nursery","id":14631425,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NjMxNDI1","avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":31830551,"node_id":"MDEwOlJlcG9zaXRvcnkzMTgzMDU1MQ==","name":"rustfmt","full_name":"rust-lang-nursery/rustfmt","private":false,"owner":{"login":"rust-lang-nursery","id":14631425,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NjMxNDI1","avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rust-lang-nursery/rustfmt","description":"Format Rust code","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/rustfmt","forks_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/rustfmt/deployments","created_at":"2015-03-07T22:51:56Z","updated_at":"2018-10-24T02:07:29Z","pushed_at":"2018-10-24T02:07:26Z","git_url":"git://github.com/rust-lang-nursery/rustfmt.git","ssh_url":"git@github.com:rust-lang-nursery/rustfmt.git","clone_url":"https://github.com/rust-lang-nursery/rustfmt.git","svn_url":"https://github.com/rust-lang-nursery/rustfmt","homepage":null,"size":8477,"stargazers_count":1834,"watchers_count":1834,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":369,"mirror_url":null,"archived":false,"open_issues_count":161,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":369,"open_issues":161,"watchers":1834,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129"},"html":{"href":"https://github.com/rust-lang-nursery/rustfmt/pull/3129"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/3129"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/issues/3129/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/pulls/3129/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/rustfmt/statuses/bd19e0ba423b44140fe389a51063552ed14123bb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nrc"}}