mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
f9ae9f62c1
Summary: This diff cleans up all remaining places that Thrift metadata is being created as a raw pointer, which had to be converted unsafely to UniquePtr in D30180770 (ff5931b944
). It also eliminates all the places that definitions of `MetadataFunc` and `RustThriftMetadata` were duplicated across the codebase. It would have been UB if any of these were to fall out of sync, as I discovered when trying to adjust the representation of RustThriftMetadata in D30180770 (ff5931b944
). Reviewed By: guswynn Differential Revision: D30182979 fbshipit-source-id: 3313440313f28863ac378986c04522d358cb4fd5
28 lines
879 B
C++
28 lines
879 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#include "eden/mononoke/scs_server/metadata.h"
|
|
#include "eden/mononoke/scs/if/gen-cpp2/source_control_metadata.h" // @manual=//eden/mononoke/scs/if:source_control-cpp2
|
|
|
|
namespace facebook {
|
|
namespace scm {
|
|
namespace service {
|
|
|
|
std::unique_ptr<rust::srserver::RustThriftMetadata> create_metadata() noexcept {
|
|
auto meta = std::make_unique<rust::srserver::RustThriftMetadata>();
|
|
meta->meta_ =
|
|
[](apache::thrift::metadata::ThriftServiceMetadataResponse& response) {
|
|
::apache::thrift::detail::md::ServiceMetadata<
|
|
::facebook::scm::service::SourceControlServiceSvIf>::gen(response);
|
|
};
|
|
return meta;
|
|
}
|
|
|
|
} // namespace service
|
|
} // namespace scm
|
|
} // namespace facebook
|