Skip to content

Commit c621a5d

Browse files
authored
Fix lint error by removing brace initialization syntax from strings. (#1095)
* Fix lint error by removing brace initialization syntax from strings.
1 parent 86d7095 commit c621a5d

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

auth/src/desktop/auth_providers/google_auth_provider.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Credential GoogleAuthProvider::GetCredential(const char* const id_token,
2727
const char* const access_token) {
2828
if (id_token && id_token[0] != '\0') {
2929
return Credential{
30-
new CredentialImpl{new GoogleAuthCredential(id_token, std::string{})}};
30+
new CredentialImpl{new GoogleAuthCredential(id_token, std::string())}};
3131
} else if (access_token) {
3232
return Credential{new CredentialImpl{
33-
new GoogleAuthCredential(std::string{}, access_token)}};
33+
new GoogleAuthCredential(std::string(), access_token)}};
3434
} else {
3535
return Credential{new CredentialImpl{
36-
new GoogleAuthCredential(std::string{}, std::string{})}};
36+
new GoogleAuthCredential(std::string(), std::string())}};
3737
}
3838
}
3939

auth/src/desktop/rpcs/verify_assertion_request.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ VerifyAssertionRequest::VerifyAssertionRequest(const char* const api_key,
3535
application_data_->requestUri = url;
3636

3737
if (provider_id) {
38-
post_body_ = std::string{"providerId="} + provider_id;
38+
post_body_ = std::string("providerId=") + provider_id;
3939
} else {
4040
LogError("No provider id given");
4141
}
@@ -55,13 +55,13 @@ std::unique_ptr<VerifyAssertionRequest> VerifyAssertionRequest::FromIdToken(
5555
new VerifyAssertionRequest{api_key, provider_id});
5656

5757
if (id_token) {
58-
request->post_body_ += std::string{"&id_token="} + id_token;
58+
request->post_body_ += std::string("&id_token=") + id_token;
5959
} else {
6060
LogError("No id token given");
6161
}
6262

6363
if (nonce) {
64-
request->post_body_ += std::string{"&nonce="} + nonce;
64+
request->post_body_ += std::string("&nonce=") + nonce;
6565
}
6666

6767
request->application_data_->postBody = request->post_body_;
@@ -83,13 +83,13 @@ std::unique_ptr<VerifyAssertionRequest> VerifyAssertionRequest::FromAccessToken(
8383
new VerifyAssertionRequest{api_key, provider_id});
8484

8585
if (access_token) {
86-
request->post_body_ += std::string{"&access_token="} + access_token;
86+
request->post_body_ += std::string("&access_token=") + access_token;
8787
} else {
8888
LogError("No access token given");
8989
}
9090

9191
if (nonce) {
92-
request->post_body_ += std::string{"&nonce="} + nonce;
92+
request->post_body_ += std::string("&nonce=") + nonce;
9393
}
9494

9595
request->application_data_->postBody = request->post_body_;
@@ -105,12 +105,12 @@ VerifyAssertionRequest::FromAccessTokenAndOAuthSecret(
105105
new VerifyAssertionRequest{api_key, provider_id});
106106

107107
if (access_token) {
108-
request->post_body_ += std::string{"&access_token="} + access_token;
108+
request->post_body_ += std::string("&access_token=") + access_token;
109109
} else {
110110
LogError("No access token given");
111111
}
112112
if (oauth_secret) {
113-
request->post_body_ += std::string{"&oauth_token_secret="} + oauth_secret;
113+
request->post_body_ += std::string("&oauth_token_secret=") + oauth_secret;
114114
} else {
115115
LogError("No OAuth secret given");
116116
}
@@ -130,7 +130,7 @@ std::unique_ptr<VerifyAssertionRequest> VerifyAssertionRequest::FromAuthCode(
130130
new VerifyAssertionRequest{api_key, provider_id});
131131

132132
if (auth_code) {
133-
request->post_body_ += std::string{"&code="} + auth_code;
133+
request->post_body_ += std::string("&code=") + auth_code;
134134
} else {
135135
LogError("No server auth code given");
136136
}

auth/tests/desktop/fakes.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ std::string GetUrlForApi(const std::string& api_key,
6666
const char* const base_url =
6767
"https://www.googleapis.com/identitytoolkit/v3/"
6868
"relyingparty/";
69-
return std::string{base_url} + api_method + "?key=" + api_key;
69+
return std::string(base_url) + api_method + "?key=" + api_key;
7070
}
7171

7272
std::string FakeSuccessfulResponse(const std::string& body) {

external/vcpkg

Submodule vcpkg updated 4367 files

firestore/integration_test_internal/src/util/integration_test_util.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ App* GetApp(const char* name, const std::string& override_project_id) {
4949
// unit tests achieve this by using fake options:
5050
// https://github.com/firebase/firebase-ios-sdk/blob/9a5afbffc17bb63b7bb7f51b9ea9a6a9e1c88a94/Firestore/core/test/firebase/firestore/testutil/app_testing.mm#L29
5151

52-
if (name == nullptr || std::string{name} == kDefaultAppName) {
52+
if (name == nullptr || std::string(name) == kDefaultAppName) {
5353
#if defined(__ANDROID__)
5454
return App::Create(app_framework::GetJniEnv(),
5555
app_framework::GetActivity());

0 commit comments

Comments
 (0)