[ledger] Fix use-after-move warning from clang-tidy
The code was in fact correct because the moved token is replaced by the
Capture afterwards, but it is better to please clang-tidy, and doesn't
cost us more than a pointer move.
LE-660 #done
TEST=clang-tidy is not complaining anymore.
Change-Id: I14826ae7557b7e48662975e2bf8f2d722dce1230
diff --git a/bin/ledger/tests/integration/merging_tests.cc b/bin/ledger/tests/integration/merging_tests.cc
index c519d19..8fe9ad3 100644
--- a/bin/ledger/tests/integration/merging_tests.cc
+++ b/bin/ledger/tests/integration/merging_tests.cc
@@ -215,13 +215,15 @@
fidl::VectorPtr<DiffEntry> new_entries;
IterationStatus status;
auto waiter = loop_controller_->NewWaiter();
+ std::unique_ptr<Token> new_token;
get_diff(std::move(token),
callback::Capture(waiter->GetCallback(), &status, &new_entries,
- &token));
+ &new_token));
if (!waiter->RunUntilCalled()) {
return ::testing::AssertionFailure()
<< "|get_diff| failed to called back.";
}
+ token = std::move(new_token);
if (!token != (status == IterationStatus::OK)) {
return ::testing::AssertionFailure()
<< "token is "