mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-13 14:27:30 -04:00
refactor(fragment_order_parser): replace folly::gen with ranges
This commit is contained in:
parent
4de04030f2
commit
bdbb40f928
@ -25,7 +25,9 @@
|
|||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include <folly/gen/String.h>
|
#include <range/v3/range/conversion.hpp>
|
||||||
|
#include <range/v3/view/join.hpp>
|
||||||
|
#include <range/v3/view/map.hpp>
|
||||||
|
|
||||||
#include <dwarfs/fragment_order_parser.h>
|
#include <dwarfs/fragment_order_parser.h>
|
||||||
#include <dwarfs/option_map.h>
|
#include <dwarfs/option_map.h>
|
||||||
@ -45,10 +47,8 @@ const std::map<std::string_view, file_order_mode> order_choices{
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
std::string fragment_order_parser::choices() {
|
std::string fragment_order_parser::choices() {
|
||||||
// TODO: C++23
|
return ranges::views::keys(order_choices) | ranges::views::join(", ") |
|
||||||
// auto tools = std::views::keys(order_choices) | std::views::join_with(", ");
|
ranges::to<std::string>();
|
||||||
using namespace folly::gen;
|
|
||||||
return from(order_choices) | get<0>() | unsplit<std::string>(", ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: find a common syntax for these options so we don't need
|
// TODO: find a common syntax for these options so we don't need
|
||||||
|
Loading…
x
Reference in New Issue
Block a user