From c1c035cf01225ff200dab8778c519c2bf4869da2 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 6 Apr 2016 20:27:13 -0400 Subject: [PATCH] moved ConfigureAwait onto same line as await --- Octokit/Clients/AssigneesClient.cs | 3 +-- Octokit/Clients/OrganizationMembersClient.cs | 6 ++--- Octokit/Clients/RepoCollaboratorsClient.cs | 3 +-- Octokit/Clients/StarredClient.cs | 12 +++------- Octokit/Helpers/AuthorizationExtensions.cs | 3 +-- Octokit/Http/ApiConnection.cs | 23 ++++---------------- Octokit/Http/Connection.cs | 9 +------- 7 files changed, 13 insertions(+), 46 deletions(-) diff --git a/Octokit/Clients/AssigneesClient.cs b/Octokit/Clients/AssigneesClient.cs index 58ca8666..0cd692c7 100644 --- a/Octokit/Clients/AssigneesClient.cs +++ b/Octokit/Clients/AssigneesClient.cs @@ -66,8 +66,7 @@ namespace Octokit try { - var response = await Connection.Get(ApiUrls.CheckAssignee(owner, name, assignee), null, null) - .ConfigureAwait(false); + var response = await Connection.Get(ApiUrls.CheckAssignee(owner, name, assignee), null, null).ConfigureAwait(false); return response.HttpResponse.IsTrue(); } catch (NotFoundException) diff --git a/Octokit/Clients/OrganizationMembersClient.cs b/Octokit/Clients/OrganizationMembersClient.cs index e657eb2e..3f24c984 100644 --- a/Octokit/Clients/OrganizationMembersClient.cs +++ b/Octokit/Clients/OrganizationMembersClient.cs @@ -244,8 +244,7 @@ namespace Octokit try { - var response = await Connection.Get(ApiUrls.CheckMemberPublic(org, user), null, null) - .ConfigureAwait(false); + var response = await Connection.Get(ApiUrls.CheckMemberPublic(org, user), null, null).ConfigureAwait(false); return response.HttpResponse.IsTrue(); } catch (NotFoundException) @@ -293,8 +292,7 @@ namespace Octokit try { var requestData = new { }; - var response = await Connection.Put(ApiUrls.OrganizationMembership(org, user), requestData) - .ConfigureAwait(false); + var response = await Connection.Put(ApiUrls.OrganizationMembership(org, user), requestData).ConfigureAwait(false); if (response.HttpResponse.StatusCode != HttpStatusCode.NoContent) { throw new ApiException("Invalid Status Code returned. Expected a 204", response.HttpResponse.StatusCode); diff --git a/Octokit/Clients/RepoCollaboratorsClient.cs b/Octokit/Clients/RepoCollaboratorsClient.cs index af46fc91..db0d41d0 100644 --- a/Octokit/Clients/RepoCollaboratorsClient.cs +++ b/Octokit/Clients/RepoCollaboratorsClient.cs @@ -57,8 +57,7 @@ namespace Octokit try { - var response = await Connection.Get(endpoint, null, null) - .ConfigureAwait(false); + var response = await Connection.Get(endpoint, null, null).ConfigureAwait(false); return response.HttpResponse.IsTrue(); } catch (NotFoundException) diff --git a/Octokit/Clients/StarredClient.cs b/Octokit/Clients/StarredClient.cs index 1ed20dcd..132ca2dc 100644 --- a/Octokit/Clients/StarredClient.cs +++ b/Octokit/Clients/StarredClient.cs @@ -189,9 +189,7 @@ namespace Octokit try { - var response = await Connection.Get(ApiUrls.Starred(owner, name), null, null) - .ConfigureAwait(false); - + var response = await Connection.Get(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false); return response.HttpResponse.StatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -213,9 +211,7 @@ namespace Octokit try { - var response = await Connection.Put(ApiUrls.Starred(owner, name), null, null) - .ConfigureAwait(false); - + var response = await Connection.Put(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false); return response.HttpResponse.StatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -237,9 +233,7 @@ namespace Octokit try { - var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name)) - .ConfigureAwait(false); - + var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name)).ConfigureAwait(false); return statusCode == HttpStatusCode.NoContent; } catch (NotFoundException) diff --git a/Octokit/Helpers/AuthorizationExtensions.cs b/Octokit/Helpers/AuthorizationExtensions.cs index 0d115ab9..1a490e8f 100644 --- a/Octokit/Helpers/AuthorizationExtensions.cs +++ b/Octokit/Helpers/AuthorizationExtensions.cs @@ -41,8 +41,7 @@ namespace Octokit TwoFactorRequiredException twoFactorException = null; try { - return await authorizationsClient.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization) - .ConfigureAwait(false); + return await authorizationsClient.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization).ConfigureAwait(false); } catch (TwoFactorRequiredException exception) { diff --git a/Octokit/Http/ApiConnection.cs b/Octokit/Http/ApiConnection.cs index 1236716a..3838e555 100644 --- a/Octokit/Http/ApiConnection.cs +++ b/Octokit/Http/ApiConnection.cs @@ -181,8 +181,7 @@ namespace Octokit parameters = Pagination.Setup(parameters, options); - return _pagination.GetAllPages(async () => await GetPage(uri, parameters, accepts, options) - .ConfigureAwait(false), uri); + return _pagination.GetAllPages(async () => await GetPage(uri, parameters, accepts, options).ConfigureAwait(false), uri); } /// @@ -258,11 +257,7 @@ namespace Octokit Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(data, "data"); - var response = await Connection.Post( - uri, - data, - accepts, - contentType).ConfigureAwait(false); + var response = await Connection.Post(uri, data, accepts, contentType).ConfigureAwait(false); return response.Body; } @@ -283,12 +278,7 @@ namespace Octokit Ensure.ArgumentNotNull(data, "data"); Ensure.ArgumentNotNull(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); - var response = await Connection.Post( - uri, - data, - accepts, - contentType, - twoFactorAuthenticationCode).ConfigureAwait(false); + var response = await Connection.Post(uri, data, accepts, contentType, twoFactorAuthenticationCode).ConfigureAwait(false); return response.Body; } @@ -298,12 +288,7 @@ namespace Octokit Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(data, "data"); - var response = await Connection.Post( - uri, - data, - accepts, - contentType, - timeout).ConfigureAwait(false); + var response = await Connection.Post(uri, data, accepts, contentType, timeout).ConfigureAwait(false); return response.Body; } diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs index c9837c6f..ac997f7c 100644 --- a/Octokit/Http/Connection.cs +++ b/Octokit/Http/Connection.cs @@ -451,14 +451,7 @@ namespace Octokit { Ensure.ArgumentNotNull(uri, "uri"); - var response = await SendData( - uri, - HttpMethod.Delete, - null, - null, - null, - CancellationToken.None, - twoFactorAuthenticationCode).ConfigureAwait(false); + var response = await SendData(uri, HttpMethod.Delete, null, null, null, CancellationToken.None, twoFactorAuthenticationCode).ConfigureAwait(false); return response.HttpResponse.StatusCode; }