diff options
| -rw-r--r-- | tde2e/td/e2e/Blockchain.cpp | 2 | ||||
| -rw-r--r-- | tde2e/td/e2e/EncryptedStorage.cpp | 2 | ||||
| -rw-r--r-- | tde2e/td/e2e/e2e_api.cpp | 8 | ||||
| -rw-r--r-- | tde2e/test/e2e.cpp | 2 | ||||
| -rw-r--r-- | tdutils/td/utils/port/FileFd.cpp | 2 | ||||
| -rw-r--r-- | tdutils/td/utils/port/SocketFd.cpp | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/tde2e/td/e2e/Blockchain.cpp b/tde2e/td/e2e/Blockchain.cpp index 2569e2958..2f45a2cb4 100644 --- a/tde2e/td/e2e/Blockchain.cpp +++ b/tde2e/td/e2e/Blockchain.cpp @@ -185,7 +185,7 @@ Block Block::from_tl(const e2e::e2e_chain_block &block) { } result.signature_ = Signature::from_u512(block.signature_); result.prev_block_hash_ = block.prev_block_hash_; - auto change_from_tl = [&](auto &obj) { + auto change_from_tl = [](auto &obj) { return Change::from_tl(*obj); }; result.changes_ = td::transform(block.changes_, change_from_tl); diff --git a/tde2e/td/e2e/EncryptedStorage.cpp b/tde2e/td/e2e/EncryptedStorage.cpp index 44aa056c3..725cc16cc 100644 --- a/tde2e/td/e2e/EncryptedStorage.cpp +++ b/tde2e/td/e2e/EncryptedStorage.cpp @@ -225,7 +225,7 @@ td::Result<EncryptedStorage::KeyValueUpdates> EncryptedStorage::apply_block(td:: for (auto &change : changes) { bool skip = false; td::Result<std::pair<Key, std::optional<Value>>> r_p; - std::visit(td::overloaded([&](ChangeNoop &noop) {}, + std::visit(td::overloaded([](ChangeNoop &noop) {}, [&](ChangeSetValue &set_value) { r_p = parse(set_value.key, set_value.value); }, [&](ChangeSetGroupState &) { skip = true; }, [&](ChangeSetSharedKey &) { skip = true; }), change.value); diff --git a/tde2e/td/e2e/e2e_api.cpp b/tde2e/td/e2e/e2e_api.cpp index 30b5cc8e0..a42b3535a 100644 --- a/tde2e/td/e2e/e2e_api.cpp +++ b/tde2e/td/e2e/e2e_api.cpp @@ -68,7 +68,7 @@ class KeyChain { td::Result<api::PrivateKeyId> generate_dummy_key() { auto hash = to_hash("dummy key", "..."); - return container_.try_build<Key>(hash, [&]() -> td::Result<PrivateKeyWithMnemonic> { + return container_.try_build<Key>(hash, []() -> td::Result<PrivateKeyWithMnemonic> { td::SecureString key(32, 1); return PrivateKeyWithMnemonic::from_private_key(PrivateKey::from_slice(key).move_as_ok(), {}); }); @@ -295,7 +295,7 @@ class KeyChain { td::Result<api::SymmetricKeyId> handshake_get_shared_key_id(api::HandshakeId handshake_id) { TRY_RESULT(handshake, container_.get_unique<Handshake>(handshake_id)); - TRY_RESULT(shared_secret, std::visit([&](auto &&v) { return v.shared_secret(); }, *handshake)); + TRY_RESULT(shared_secret, std::visit([](auto &&v) { return v.shared_secret(); }, *handshake)); auto hash = to_hash("handshake shared_secret", shared_secret.as_slice()); return container_.try_build<Key>(hash, [&]() -> td::Result<td::SecureString> { return std::move(shared_secret); }); } @@ -559,8 +559,8 @@ class KeyChain { td::Result<PublicKey> to_public_key(api::AnyKeyId key_id) const { TRY_RESULT(key, container_.get_shared<Key>(key_id)); return std::visit( - td::overloaded([&](const PrivateKeyWithMnemonic &pk) -> td::Result<PublicKey> { return pk.to_public_key(); }, - [&](const PublicKey &pk) -> td::Result<PublicKey> { return pk; }, + td::overloaded([](const PrivateKeyWithMnemonic &pk) -> td::Result<PublicKey> { return pk.to_public_key(); }, + [](const PublicKey &pk) -> td::Result<PublicKey> { return pk; }, [](const auto &) -> td::Result<PublicKey> { return td::Status::Error(static_cast<int>(api::ErrorCode::InvalidInput), "key_id doesn't contain public key"); diff --git a/tde2e/test/e2e.cpp b/tde2e/test/e2e.cpp index 0f96a56a3..f60faf6bb 100644 --- a/tde2e/test/e2e.cpp +++ b/tde2e/test/e2e.cpp @@ -590,7 +590,7 @@ struct BaselineBlockchainState { } void apply_changes(const std::vector<Change> &changes) { for (const auto &change_v : changes) { - std::visit(td::overloaded([&](const ChangeNoop &) {}, + std::visit(td::overloaded([](const ChangeNoop &) {}, [&](const ChangeSetValue &change) { key_value_state[change.key] = change.value; }, [&](const ChangeSetGroupState &change) { group_state = change.group_state; }, [&](const ChangeSetSharedKey &change) { shared_key = change.shared_key; }), diff --git a/tdutils/td/utils/port/FileFd.cpp b/tdutils/td/utils/port/FileFd.cpp index d01631d9c..eadf0ac28 100644 --- a/tdutils/td/utils/port/FileFd.cpp +++ b/tdutils/td/utils/port/FileFd.cpp @@ -168,7 +168,7 @@ Result<FileFd> FileFd::open(CSlice filepath, int32 flags, int32 mode) { if (native_fd < MINIMUM_FILE_DESCRIPTOR) { ::close(native_fd); LOG(ERROR) << "Receive " << native_fd << " as a file descriptor"; - int dummy_fd = detail::skip_eintr([&] { return ::open("/dev/null", O_RDONLY, 0); }); + int dummy_fd = detail::skip_eintr([] { return ::open("/dev/null", O_RDONLY, 0); }); if (dummy_fd < 0) { return OS_ERROR("Can't open /dev/null"); } diff --git a/tdutils/td/utils/port/SocketFd.cpp b/tdutils/td/utils/port/SocketFd.cpp index 95df9d690..5f784c43b 100644 --- a/tdutils/td/utils/port/SocketFd.cpp +++ b/tdutils/td/utils/port/SocketFd.cpp @@ -643,7 +643,7 @@ Result<SocketFd> SocketFd::open(const IPAddress &address) { while (native_fd.socket() < MINIMUM_FILE_DESCRIPTOR) { native_fd.close(); LOG(ERROR) << "Receive " << native_fd << " as a file descriptor"; - int dummy_fd = detail::skip_eintr([&] { return ::open("/dev/null", O_RDONLY, 0); }); + int dummy_fd = detail::skip_eintr([] { return ::open("/dev/null", O_RDONLY, 0); }); if (dummy_fd < 0) { return OS_ERROR("Can't open /dev/null"); } |
