mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 05:52:23 +08:00
🧹 gucc: refactor with clang-tidy
This commit is contained in:
parent
eefb1ae1be
commit
4c23dccdcf
@ -22,30 +22,30 @@ using namespace std::string_view_literals;
|
||||
if (line.starts_with(needle)) { \
|
||||
return fmt::format(needle "\"{}\"", f); \
|
||||
}
|
||||
#define CONV_OPT_F(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "{}", *f); \
|
||||
} \
|
||||
return {"#" needle default_val}; \
|
||||
#define CONV_OPT_F(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "{}", *(f)); \
|
||||
} \
|
||||
return {"#" needle default_val}; \
|
||||
}
|
||||
#define CONV_OPT_F_S(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "\"{}\"", *f); \
|
||||
} \
|
||||
return {"#" needle "\"" default_val "\""}; \
|
||||
#define CONV_OPT_F_S(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "\"{}\"", *(f)); \
|
||||
} \
|
||||
return {"#" needle "\"" default_val "\""}; \
|
||||
}
|
||||
#define CONV_REQ_B(needle, f) \
|
||||
if (line.starts_with(needle)) { \
|
||||
return fmt::format(needle "{}", convert_boolean_val(needle, f)); \
|
||||
}
|
||||
#define CONV_OPT_B(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "{}", convert_boolean_val(needle, *f)); \
|
||||
} \
|
||||
return {"#" needle default_val}; \
|
||||
#define CONV_OPT_B(needle, f, default_val) \
|
||||
if (line.starts_with(needle)) { \
|
||||
if (f) { \
|
||||
return fmt::format(needle "{}", convert_boolean_val(needle, *(f))); \
|
||||
} \
|
||||
return {"#" needle default_val}; \
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -44,7 +44,7 @@ auto parse_desktop_profiles(std::string_view config_content) noexcept -> std::op
|
||||
|
||||
std::vector<DesktopProfile> desktop_profiles{};
|
||||
|
||||
auto desktop_table = netprof_table["desktop"].as_table();
|
||||
const auto* desktop_table = netprof_table["desktop"].as_table();
|
||||
for (auto&& [key, value] : *desktop_table) {
|
||||
auto value_table = *value.as_table();
|
||||
std::vector<std::string> desktop_profile_packages{};
|
||||
@ -69,7 +69,7 @@ auto parse_net_profiles(std::string_view config_content) noexcept -> std::option
|
||||
parse_toml_array(netprof_table["base-packages"]["desktop"]["packages"].as_array(), net_profiles.base_profiles.base_desktop_packages);
|
||||
|
||||
// parse desktop
|
||||
auto desktop_table = netprof_table["desktop"].as_table();
|
||||
const auto* desktop_table = netprof_table["desktop"].as_table();
|
||||
for (auto&& [key, value] : *desktop_table) {
|
||||
auto value_table = *value.as_table();
|
||||
std::vector<std::string> desktop_profile_packages{};
|
||||
|
Loading…
Reference in New Issue
Block a user