Codechange: minor bits and pieces related to fmt::format() (#11806)

- Don't make run-time formatting what can be done compile-time.
- Be explicit about run-time formatting.
- Fix datetime printing.
This commit is contained in:
Patric Stout
2024-01-16 22:10:34 +01:00
committed by GitHub
parent 0b7410d979
commit 6550682b49
4 changed files with 8 additions and 4 deletions

View File

@@ -93,7 +93,7 @@ static const char *GetAddressFormatString(uint16_t family, bool with_family)
*/
std::string NetworkAddress::GetAddressAsString(bool with_family)
{
return fmt::format(GetAddressFormatString(this->GetAddress()->ss_family, with_family), this->GetHostname(), this->GetPort());
return fmt::format(fmt::runtime(GetAddressFormatString(this->GetAddress()->ss_family, with_family)), this->GetHostname(), this->GetPort());
}
/**