client/Response: add method Fmt() based on libfmt

This commit is contained in:
Max Kellermann
2021-05-21 20:35:29 +02:00
parent a9c704b76e
commit 0440c41cba
27 changed files with 241 additions and 195 deletions

View File

@@ -25,6 +25,8 @@
#include "neighbor/Glue.hxx"
#include "neighbor/Info.hxx"
#include <fmt/format.h>
#include <string>
bool
@@ -44,9 +46,9 @@ handle_listneighbors(Client &client, [[maybe_unused]] Request args, Response &r)
}
for (const auto &i : neighbors->GetList())
r.Format("neighbor: %s\n"
"name: %s\n",
i.uri.c_str(),
i.display_name.c_str());
r.Fmt(FMT_STRING("neighbor: {}\n"
"name: {}\n"),
i.uri,
i.display_name);
return CommandResult::OK;
}