Use fmt::runtime where needed in C++20 (#3962)

This commit is contained in:
Antoine Prouvost 2025-06-02 14:10:43 +02:00 committed by GitHub
parent 703c8d7602
commit 6e4be2889c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 6 deletions

View File

@ -432,7 +432,7 @@ namespace mamba
}
else
{
return fmt::format(m_format, val, w);
return fmt::format(fmt::runtime(m_format), val, w);
}
}
else

View File

@ -1314,8 +1314,12 @@ namespace mamba::solver
{
const auto style = tn.status ? m_format.available : m_format.unavailable;
auto [versions_trunc, size] = node.versions_trunc();
write(fmt::format(style, (size == 1 ? "{} {}" : "{} [{}]"), node.name(), versions_trunc)
);
write(fmt::format(
style,
fmt::runtime(size == 1 ? "{} {}" : "{} [{}]"),
node.name(),
versions_trunc
));
}
};
std::visit(do_write, concat_nodes(tn.ids));
@ -1381,7 +1385,7 @@ namespace mamba::solver
{
write(fmt::format(
style,
(size == 1 ? "{} {}" : "{} [{}]"),
fmt::runtime(size == 1 ? "{} {}" : "{} [{}]"),
edges.name(),
relevant_vers_builds_trunc
));

View File

@ -419,7 +419,7 @@ namespace mamba::specs
// with the custom parser
// return fmt::format("{:{}}", *this, level);
auto fmt = fmt::format("{{:{}}}", level);
return fmt::format(fmt, *this);
return fmt::format(fmt::runtime(fmt), *this);
}
auto Version::to_string_glob() const -> std::string

View File

@ -807,7 +807,7 @@ fmt::formatter<mamba::specs::VersionSpec>::format(
}
if constexpr (std::is_same_v<Token, tree_type::variable_type>)
{
out = fmt::format_to(out, conda_build_form ? "{:b}" : "{}", token);
out = fmt::format_to(out, fmt::runtime(conda_build_form ? "{:b}" : "{}"), token);
}
}
);