{"action":"created","comment":{"url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/comments/365068159","pull_request_review_id":340948681,"id":365068159,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2NTA2ODE1OQ==","diff_hunk":"@@ -522,46 +573,57 @@ impl<'r> ResponseBuilder<'r> {\n     /// let custom_values: Vec<_> = response.headers().get(\"X-Custom\").collect();\n     /// assert_eq!(custom_values, vec![\"value 2\", \"value 3\", \"value 1\"]);\n     /// # }\n+    /// \n+    /// # })\n     /// ```\n     #[inline(always)]\n     pub fn join(&mut self, other: Response<'r>) -> &mut ResponseBuilder<'r> {\n         self.response.join(other);\n         self\n     }\n \n-    /// Retrieve the built `Response`.\n-    ///\n-    /// # Example\n-    ///\n-    /// ```rust\n-    /// use rocket::Response;\n-    ///\n-    /// # #[allow(unused_variables)]\n-    /// let response = Response::build()\n-    ///     // build the response\n-    ///     .finalize();\n-    /// ```\n-    #[inline(always)]\n-    pub fn finalize(&mut self) -> Response<'r> {\n-        std::mem::replace(&mut self.response, Response::new())\n-    }\n-\n     /// Retrieve the built `Response` wrapped in `Ok`.\n     ///\n     /// # Example\n     ///\n     /// ```rust\n     /// use rocket::Response;\n+    /// \n+    /// # rocket::async_test(async {\n     ///\n     /// let response: Result<Response, ()> = Response::build()\n     ///     // build the response\n-    ///     .ok();\n+    ///     .ok().await;\n     ///\n     /// assert!(response.is_ok());\n+    /// \n+    /// # })\n     /// ```\n     #[inline(always)]\n-    pub fn ok<T>(&mut self) -> Result<Response<'r>, T> {\n-        Ok(self.finalize())\n+    pub async fn ok<E>(&mut self) -> Result<Response<'r>, E> {\n+        Ok(self.await)\n+    }\n+}\n+\n+impl<'r> Future for ResponseBuilder<'r> {\n+    type Output = Response<'r>;\n+    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {","path":"core/lib/src/response/response.rs","position":384,"original_position":384,"commit_id":"540a815da1ffc2b98575a8f7a81ffc76bccb2a8d","original_commit_id":"540a815da1ffc2b98575a8f7a81ffc76bccb2a8d","user":{"login":"jebrosen","id":7102588,"node_id":"MDQ6VXNlcjcxMDI1ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/7102588?v=4","gravatar_id":"","url":"https://api.github.com/users/jebrosen","html_url":"https://github.com/jebrosen","followers_url":"https://api.github.com/users/jebrosen/followers","following_url":"https://api.github.com/users/jebrosen/following{/other_user}","gists_url":"https://api.github.com/users/jebrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/jebrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jebrosen/subscriptions","organizations_url":"https://api.github.com/users/jebrosen/orgs","repos_url":"https://api.github.com/users/jebrosen/repos","events_url":"https://api.github.com/users/jebrosen/events{/privacy}","received_events_url":"https://api.github.com/users/jebrosen/received_events","type":"User","site_admin":false},"body":"I would be happy to tackle this part last. My main hesitation is that adding functionality to the manual implementation will be harder than adding it to an `async fn`, and implementing `Future` directly on `ResponseBuilder` is a strong commitment in comparison.","created_at":"2020-01-10T04:25:50Z","updated_at":"2020-01-10T04:25:50Z","html_url":"https://github.com/SergioBenitez/Rocket/pull/1196#discussion_r365068159","pull_request_url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/comments/365068159"},"html":{"href":"https://github.com/SergioBenitez/Rocket/pull/1196#discussion_r365068159"},"pull_request":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196"}},"in_reply_to_id":365039468},"pull_request":{"url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196","id":359845435,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU5ODQ1NDM1","html_url":"https://github.com/SergioBenitez/Rocket/pull/1196","diff_url":"https://github.com/SergioBenitez/Rocket/pull/1196.diff","patch_url":"https://github.com/SergioBenitez/Rocket/pull/1196.patch","issue_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/1196","number":1196,"state":"open","locked":false,"title":"Migrate over to AsyncSeek","user":{"login":"notriddle","id":1593513,"node_id":"MDQ6VXNlcjE1OTM1MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1593513?v=4","gravatar_id":"","url":"https://api.github.com/users/notriddle","html_url":"https://github.com/notriddle","followers_url":"https://api.github.com/users/notriddle/followers","following_url":"https://api.github.com/users/notriddle/following{/other_user}","gists_url":"https://api.github.com/users/notriddle/gists{/gist_id}","starred_url":"https://api.github.com/users/notriddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notriddle/subscriptions","organizations_url":"https://api.github.com/users/notriddle/orgs","repos_url":"https://api.github.com/users/notriddle/repos","events_url":"https://api.github.com/users/notriddle/events{/privacy}","received_events_url":"https://api.github.com/users/notriddle/received_events","type":"User","site_admin":false},"body":"This is a fairly complicated change, because the rest of the framework\r\nwants to know the size of the sized body right away, but we need to\r\nfetch it asynchronously. I'm not sure if this is an elegant-enough\r\nsolution.\r\n\r\nThis commit changes the `Response::set_sized_body` in the obvious way,\r\nbut to preserve the builder pattern, `ResponseBuilder` is changed so\r\nthat the act of finalizing it is asynchronous, rather than attempting to\r\nmake the `sized_body()` function asynchronous.","created_at":"2020-01-07T06:31:41Z","updated_at":"2020-01-10T04:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4149182ba8c03e82e24129e80eb98bc772bdfb1","assignee":{"login":"jebrosen","id":7102588,"node_id":"MDQ6VXNlcjcxMDI1ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/7102588?v=4","gravatar_id":"","url":"https://api.github.com/users/jebrosen","html_url":"https://github.com/jebrosen","followers_url":"https://api.github.com/users/jebrosen/followers","following_url":"https://api.github.com/users/jebrosen/following{/other_user}","gists_url":"https://api.github.com/users/jebrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/jebrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jebrosen/subscriptions","organizations_url":"https://api.github.com/users/jebrosen/orgs","repos_url":"https://api.github.com/users/jebrosen/repos","events_url":"https://api.github.com/users/jebrosen/events{/privacy}","received_events_url":"https://api.github.com/users/jebrosen/received_events","type":"User","site_admin":false},"assignees":[{"login":"jebrosen","id":7102588,"node_id":"MDQ6VXNlcjcxMDI1ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/7102588?v=4","gravatar_id":"","url":"https://api.github.com/users/jebrosen","html_url":"https://github.com/jebrosen","followers_url":"https://api.github.com/users/jebrosen/followers","following_url":"https://api.github.com/users/jebrosen/following{/other_user}","gists_url":"https://api.github.com/users/jebrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/jebrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jebrosen/subscriptions","organizations_url":"https://api.github.com/users/jebrosen/orgs","repos_url":"https://api.github.com/users/jebrosen/repos","events_url":"https://api.github.com/users/jebrosen/events{/privacy}","received_events_url":"https://api.github.com/users/jebrosen/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196/commits","review_comments_url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196/comments","review_comment_url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/1196/comments","statuses_url":"https://api.github.com/repos/SergioBenitez/Rocket/statuses/540a815da1ffc2b98575a8f7a81ffc76bccb2a8d","head":{"label":"notriddle:async","ref":"async","sha":"540a815da1ffc2b98575a8f7a81ffc76bccb2a8d","user":{"login":"notriddle","id":1593513,"node_id":"MDQ6VXNlcjE1OTM1MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1593513?v=4","gravatar_id":"","url":"https://api.github.com/users/notriddle","html_url":"https://github.com/notriddle","followers_url":"https://api.github.com/users/notriddle/followers","following_url":"https://api.github.com/users/notriddle/following{/other_user}","gists_url":"https://api.github.com/users/notriddle/gists{/gist_id}","starred_url":"https://api.github.com/users/notriddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notriddle/subscriptions","organizations_url":"https://api.github.com/users/notriddle/orgs","repos_url":"https://api.github.com/users/notriddle/repos","events_url":"https://api.github.com/users/notriddle/events{/privacy}","received_events_url":"https://api.github.com/users/notriddle/received_events","type":"User","site_admin":false},"repo":{"id":178279188,"node_id":"MDEwOlJlcG9zaXRvcnkxNzgyNzkxODg=","name":"Rocket","full_name":"notriddle/Rocket","private":false,"owner":{"login":"notriddle","id":1593513,"node_id":"MDQ6VXNlcjE1OTM1MTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1593513?v=4","gravatar_id":"","url":"https://api.github.com/users/notriddle","html_url":"https://github.com/notriddle","followers_url":"https://api.github.com/users/notriddle/followers","following_url":"https://api.github.com/users/notriddle/following{/other_user}","gists_url":"https://api.github.com/users/notriddle/gists{/gist_id}","starred_url":"https://api.github.com/users/notriddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notriddle/subscriptions","organizations_url":"https://api.github.com/users/notriddle/orgs","repos_url":"https://api.github.com/users/notriddle/repos","events_url":"https://api.github.com/users/notriddle/events{/privacy}","received_events_url":"https://api.github.com/users/notriddle/received_events","type":"User","site_admin":false},"html_url":"https://github.com/notriddle/Rocket","description":"A web framework for Rust.","fork":true,"url":"https://api.github.com/repos/notriddle/Rocket","forks_url":"https://api.github.com/repos/notriddle/Rocket/forks","keys_url":"https://api.github.com/repos/notriddle/Rocket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/notriddle/Rocket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/notriddle/Rocket/teams","hooks_url":"https://api.github.com/repos/notriddle/Rocket/hooks","issue_events_url":"https://api.github.com/repos/notriddle/Rocket/issues/events{/number}","events_url":"https://api.github.com/repos/notriddle/Rocket/events","assignees_url":"https://api.github.com/repos/notriddle/Rocket/assignees{/user}","branches_url":"https://api.github.com/repos/notriddle/Rocket/branches{/branch}","tags_url":"https://api.github.com/repos/notriddle/Rocket/tags","blobs_url":"https://api.github.com/repos/notriddle/Rocket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/notriddle/Rocket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/notriddle/Rocket/git/refs{/sha}","trees_url":"https://api.github.com/repos/notriddle/Rocket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/notriddle/Rocket/statuses/{sha}","languages_url":"https://api.github.com/repos/notriddle/Rocket/languages","stargazers_url":"https://api.github.com/repos/notriddle/Rocket/stargazers","contributors_url":"https://api.github.com/repos/notriddle/Rocket/contributors","subscribers_url":"https://api.github.com/repos/notriddle/Rocket/subscribers","subscription_url":"https://api.github.com/repos/notriddle/Rocket/subscription","commits_url":"https://api.github.com/repos/notriddle/Rocket/commits{/sha}","git_commits_url":"https://api.github.com/repos/notriddle/Rocket/git/commits{/sha}","comments_url":"https://api.github.com/repos/notriddle/Rocket/comments{/number}","issue_comment_url":"https://api.github.com/repos/notriddle/Rocket/issues/comments{/number}","contents_url":"https://api.github.com/repos/notriddle/Rocket/contents/{+path}","compare_url":"https://api.github.com/repos/notriddle/Rocket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/notriddle/Rocket/merges","archive_url":"https://api.github.com/repos/notriddle/Rocket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/notriddle/Rocket/downloads","issues_url":"https://api.github.com/repos/notriddle/Rocket/issues{/number}","pulls_url":"https://api.github.com/repos/notriddle/Rocket/pulls{/number}","milestones_url":"https://api.github.com/repos/notriddle/Rocket/milestones{/number}","notifications_url":"https://api.github.com/repos/notriddle/Rocket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/notriddle/Rocket/labels{/name}","releases_url":"https://api.github.com/repos/notriddle/Rocket/releases{/id}","deployments_url":"https://api.github.com/repos/notriddle/Rocket/deployments","created_at":"2019-03-28T20:42:08Z","updated_at":"2019-03-28T20:42:11Z","pushed_at":"2020-01-10T00:48:47Z","git_url":"git://github.com/notriddle/Rocket.git","ssh_url":"git@github.com:notriddle/Rocket.git","clone_url":"https://github.com/notriddle/Rocket.git","svn_url":"https://github.com/notriddle/Rocket","homepage":"https://rocket.rs","size":3846,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":"SergioBenitez:async","ref":"async","sha":"6e6fb2866ec8192f7deaf82fb807df9d484ee2bf","user":{"login":"SergioBenitez","id":1480321,"node_id":"MDQ6VXNlcjE0ODAzMjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1480321?v=4","gravatar_id":"","url":"https://api.github.com/users/SergioBenitez","html_url":"https://github.com/SergioBenitez","followers_url":"https://api.github.com/users/SergioBenitez/followers","following_url":"https://api.github.com/users/SergioBenitez/following{/other_user}","gists_url":"https://api.github.com/users/SergioBenitez/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioBenitez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioBenitez/subscriptions","organizations_url":"https://api.github.com/users/SergioBenitez/orgs","repos_url":"https://api.github.com/users/SergioBenitez/repos","events_url":"https://api.github.com/users/SergioBenitez/events{/privacy}","received_events_url":"https://api.github.com/users/SergioBenitez/received_events","type":"User","site_admin":false},"repo":{"id":54168759,"node_id":"MDEwOlJlcG9zaXRvcnk1NDE2ODc1OQ==","name":"Rocket","full_name":"SergioBenitez/Rocket","private":false,"owner":{"login":"SergioBenitez","id":1480321,"node_id":"MDQ6VXNlcjE0ODAzMjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1480321?v=4","gravatar_id":"","url":"https://api.github.com/users/SergioBenitez","html_url":"https://github.com/SergioBenitez","followers_url":"https://api.github.com/users/SergioBenitez/followers","following_url":"https://api.github.com/users/SergioBenitez/following{/other_user}","gists_url":"https://api.github.com/users/SergioBenitez/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioBenitez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioBenitez/subscriptions","organizations_url":"https://api.github.com/users/SergioBenitez/orgs","repos_url":"https://api.github.com/users/SergioBenitez/repos","events_url":"https://api.github.com/users/SergioBenitez/events{/privacy}","received_events_url":"https://api.github.com/users/SergioBenitez/received_events","type":"User","site_admin":false},"html_url":"https://github.com/SergioBenitez/Rocket","description":"A web framework for Rust.","fork":false,"url":"https://api.github.com/repos/SergioBenitez/Rocket","forks_url":"https://api.github.com/repos/SergioBenitez/Rocket/forks","keys_url":"https://api.github.com/repos/SergioBenitez/Rocket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SergioBenitez/Rocket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SergioBenitez/Rocket/teams","hooks_url":"https://api.github.com/repos/SergioBenitez/Rocket/hooks","issue_events_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/events{/number}","events_url":"https://api.github.com/repos/SergioBenitez/Rocket/events","assignees_url":"https://api.github.com/repos/SergioBenitez/Rocket/assignees{/user}","branches_url":"https://api.github.com/repos/SergioBenitez/Rocket/branches{/branch}","tags_url":"https://api.github.com/repos/SergioBenitez/Rocket/tags","blobs_url":"https://api.github.com/repos/SergioBenitez/Rocket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SergioBenitez/Rocket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SergioBenitez/Rocket/git/refs{/sha}","trees_url":"https://api.github.com/repos/SergioBenitez/Rocket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SergioBenitez/Rocket/statuses/{sha}","languages_url":"https://api.github.com/repos/SergioBenitez/Rocket/languages","stargazers_url":"https://api.github.com/repos/SergioBenitez/Rocket/stargazers","contributors_url":"https://api.github.com/repos/SergioBenitez/Rocket/contributors","subscribers_url":"https://api.github.com/repos/SergioBenitez/Rocket/subscribers","subscription_url":"https://api.github.com/repos/SergioBenitez/Rocket/subscription","commits_url":"https://api.github.com/repos/SergioBenitez/Rocket/commits{/sha}","git_commits_url":"https://api.github.com/repos/SergioBenitez/Rocket/git/commits{/sha}","comments_url":"https://api.github.com/repos/SergioBenitez/Rocket/comments{/number}","issue_comment_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues/comments{/number}","contents_url":"https://api.github.com/repos/SergioBenitez/Rocket/contents/{+path}","compare_url":"https://api.github.com/repos/SergioBenitez/Rocket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SergioBenitez/Rocket/merges","archive_url":"https://api.github.com/repos/SergioBenitez/Rocket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SergioBenitez/Rocket/downloads","issues_url":"https://api.github.com/repos/SergioBenitez/Rocket/issues{/number}","pulls_url":"https://api.github.com/repos/SergioBenitez/Rocket/pulls{/number}","milestones_url":"https://api.github.com/repos/SergioBenitez/Rocket/milestones{/number}","notifications_url":"https://api.github.com/repos/SergioBenitez/Rocket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SergioBenitez/Rocket/labels{/name}","releases_url":"https://api.github.com/repos/SergioBenitez/Rocket/releases{/id}","deployments_url":"https://api.github.com/repos/SergioBenitez/Rocket/deployments","created_at":"2016-03-18T02:50:18Z","updated_at":"2020-01-09T21:18:12Z","pushed_at":"2020-01-10T00:48:50Z","git_url":"git://github.com/SergioBenitez/Rocket.git","ssh_url":"git@github.com:SergioBenitez/Rocket.git","clone_url":"https://github.com/SergioBenitez/Rocket.git","svn_url":"https://github.com/SergioBenitez/Rocket","homepage":"https://rocket.rs","size":3922,"stargazers_count":8678,"watchers_count":8678,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":599,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":121,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":599,"open_issues":121,"watchers":8678,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196"},"html":{"href":"https://github.com/SergioBenitez/Rocket/pull/1196"},"issue":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/issues/1196"},"comments":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/issues/1196/comments"},"review_comments":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196/comments"},"review_comment":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/pulls/1196/commits"},"statuses":{"href":"https://api.github.com/repos/SergioBenitez/Rocket/statuses/540a815da1ffc2b98575a8f7a81ffc76bccb2a8d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jebrosen"}}