mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 22:42:31 +08:00
👷 gucc: use std ranges from C++23 in umount
This commit is contained in:
parent
ff2e64bfee
commit
e2a39f2a8b
@ -2,26 +2,9 @@
|
||||
#include "gucc/file_utils.hpp"
|
||||
#include "gucc/io_utils.hpp"
|
||||
#include "gucc/mtab.hpp"
|
||||
#include "gucc/string_utils.hpp"
|
||||
|
||||
#include <algorithm> // for sort
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wold-style-cast"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuseless-cast"
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#endif
|
||||
|
||||
#include <range/v3/algorithm/sort.hpp>
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#include <ranges> // for ranges::*
|
||||
|
||||
#include <fmt/compile.h>
|
||||
#include <fmt/format.h>
|
||||
@ -38,7 +21,7 @@ auto umount_partitions(std::string_view root_mountpoint, const std::vector<std::
|
||||
spdlog::error("Failed to umount partitions: failed to parse /etc/mtab");
|
||||
return false;
|
||||
}
|
||||
ranges::sort(*mtab_entries, {}, &mtab::MTabEntry::mountpoint);
|
||||
std::ranges::sort(*mtab_entries, {}, &mtab::MTabEntry::mountpoint);
|
||||
|
||||
spdlog::debug("Got {} entries from mountpoint {}", mtab_entries->size(), root_mountpoint);
|
||||
for (auto&& mtab_entry : std::move(*mtab_entries)) {
|
||||
|
Loading…
Reference in New Issue
Block a user