refactor(dwarfs-universal): replace folly::gen with ranges

This commit is contained in:
Marcus Holland-Moritz 2024-05-22 15:28:31 +02:00
parent 89cdb7e325
commit 4de04030f2
2 changed files with 8 additions and 7 deletions

View File

@ -816,7 +816,8 @@ if(WITH_UNIVERSAL_BINARY)
add_executable(dwarfsuniversal src/universal.cpp) add_executable(dwarfsuniversal src/universal.cpp)
list(APPEND BINARY_TARGETS dwarfsuniversal) list(APPEND BINARY_TARGETS dwarfsuniversal)
target_link_libraries(dwarfsuniversal PRIVATE mkdwarfs_main dwarfsck_main dwarfsextract_main) target_link_libraries(dwarfsuniversal PRIVATE
mkdwarfs_main dwarfsck_main dwarfsextract_main range-v3::range-v3)
set_target_properties(dwarfsuniversal PROPERTIES set_target_properties(dwarfsuniversal PROPERTIES
RUNTIME_OUTPUT_DIRECTORY universal RUNTIME_OUTPUT_DIRECTORY universal
OUTPUT_NAME dwarfs-universal) OUTPUT_NAME dwarfs-universal)

View File

@ -28,9 +28,12 @@
#include <vector> #include <vector>
#include <folly/String.h> #include <folly/String.h>
#include <folly/gen/String.h>
#include <folly/portability/Windows.h> #include <folly/portability/Windows.h>
#include <range/v3/range/conversion.hpp>
#include <range/v3/view/join.hpp>
#include <range/v3/view/map.hpp>
#include <dwarfs/safe_main.h> #include <dwarfs/safe_main.h>
#include <dwarfs/tool.h> #include <dwarfs/tool.h>
#include <dwarfs/util.h> #include <dwarfs/util.h>
@ -85,11 +88,8 @@ int SYS_MAIN(int argc, sys_char** argv) {
// nope, just print the help // nope, just print the help
using namespace folly::gen; auto tools = ranges::views::keys(functions) | ranges::views::join(", ") |
ranges::to<std::string>;
// TODO: C++23
// auto tools = std::views::keys(functions) | std::views::join_with(", ");
auto tools = from(functions) | get<0>() | unsplit(", ");
// clang-format off // clang-format off
std::cout << tool_header("dwarfs-universal") std::cout << tool_header("dwarfs-universal")