Skip to content

Commit 18389a0

Browse files
committed
fix the format
1 parent 233a550 commit 18389a0

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

google/cloud/storage/internal/async/connection_impl.cc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ AsyncConnectionImpl::AppendableObjectUploadImpl(AppendableUploadParams p) {
403403
return pending.then(
404404
[current, request = std::move(p.request), persisted_size,
405405
fa = std::move(factory)](auto f) mutable
406-
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
406+
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
407407
auto rpc = f.get();
408408
if (!rpc) return std::move(rpc).status();
409409

@@ -470,7 +470,7 @@ AsyncConnectionImpl::StartBufferedUpload(UploadParams p) {
470470
return StartUnbufferedUpload(std::move(p))
471471
.then([current = std::move(current),
472472
async_write_object = std::move(async_write_object)](auto f) mutable
473-
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
473+
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
474474
auto w = f.get();
475475
if (!w) return std::move(w).status();
476476
auto factory = [upload_id = (*w)->UploadId(),
@@ -504,15 +504,14 @@ AsyncConnectionImpl::ResumeBufferedUpload(ResumeUploadParams p) {
504504
};
505505

506506
auto f = make_unbuffered();
507-
return f.then(
508-
[current = std::move(current),
509-
make_unbuffered = std::move(make_unbuffered)](auto f) mutable
510-
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
511-
auto w = f.get();
512-
if (!w) return std::move(w).status();
513-
return MakeWriterConnectionBuffered(std::move(make_unbuffered),
514-
*std::move(w), *current);
515-
});
507+
return f.then([current = std::move(current),
508+
make_unbuffered = std::move(make_unbuffered)](auto f) mutable
509+
-> StatusOr<std::unique_ptr<storage::AsyncWriterConnection>> {
510+
auto w = f.get();
511+
if (!w) return std::move(w).status();
512+
return MakeWriterConnectionBuffered(std::move(make_unbuffered),
513+
*std::move(w), *current);
514+
});
516515
}
517516

518517
future<StatusOr<google::storage::v2::Object>>

google/cloud/storage/internal/async/connection_impl_appendable_upload_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "google/cloud/storage/internal/async/connection_impl.h"
1919
#include "google/cloud/storage/internal/async/default_options.h"
2020
#include "google/cloud/storage/testing/canonical_errors.h"
21+
#include "google/cloud/storage/internal/crc32c.h"
2122
#include "google/cloud/storage/testing/mock_storage_stub.h"
2223
#include "google/cloud/common_options.h"
2324
#include "google/cloud/grpc_options.h"
@@ -698,6 +699,8 @@ TEST_F(AsyncConnectionImplAppendableTest,
698699
// Here we expect full checksums to be set because we had the resource
699700
// in takeover.
700701
EXPECT_TRUE(request.has_object_checksums());
702+
auto expected_crc = google::cloud::storage_internal::ExtendCrc32c(12345, "some data");
703+
EXPECT_EQ(request.object_checksums().crc32c(), expected_crc);
701704
return sequencer.PushBack("Write(Finalize)");
702705
});
703706

0 commit comments

Comments
 (0)