Upgrade to fmt 10.1.0 (#5326)

This commit is contained in:
Tyler Veness
2023-08-28 15:15:14 -07:00
committed by GitHub
parent 8e2a7fd306
commit 165ebe4c79
27 changed files with 3366 additions and 3257 deletions

View File

@@ -193,7 +193,8 @@ wpi::HttpConnection* HttpCameraImpl::DeviceStreamConnect(
auto [mediaType, contentType] = wpi::split(conn->contentType.str(), ';');
mediaType = wpi::trim(mediaType);
if (mediaType != "multipart/x-mixed-replace") {
SWARNING("\"{}\": unrecognized Content-Type \"{}\"", req.host, mediaType);
SWARNING("\"{}\": unrecognized Content-Type \"{}\"", req.host.str(),
mediaType);
std::scoped_lock lock(m_mutex);
m_streamConn = nullptr;
return nullptr;
@@ -216,7 +217,8 @@ wpi::HttpConnection* HttpCameraImpl::DeviceStreamConnect(
}
if (boundary.empty()) {
SWARNING("\"{}\": empty multi-part boundary or no Content-Type", req.host);
SWARNING("\"{}\": empty multi-part boundary or no Content-Type",
req.host.str());
std::scoped_lock lock(m_mutex);
m_streamConn = nullptr;
return nullptr;
@@ -281,8 +283,8 @@ bool HttpCameraImpl::DeviceStreamFrame(wpi::raw_istream& is,
// Check the content type (if present)
if (!contentTypeBuf.str().empty() &&
!wpi::starts_with(contentTypeBuf, "image/jpeg")) {
auto errMsg =
fmt::format("received unknown Content-Type \"{}\"", contentTypeBuf);
auto errMsg = fmt::format("received unknown Content-Type \"{}\"",
contentTypeBuf.str());
SWARNING("{}", errMsg);
PutError(errMsg, wpi::Now());
return false;

View File

@@ -400,12 +400,12 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::raw_ostream& os,
fmt::print(os,
"<input id=\"{0}{1}\" type=\"radio\" name=\"{0}\" "
"value=\"{2}\" onclick=\"update('{0}', {1})\"",
name, j, ch_name);
name, j, ch_name.str());
if (j == valE) {
os << " checked";
}
fmt::print(os, " /><label for=\"{}{}\">{}</label>\n", name, j,
ch_name);
ch_name.str());
}
break;
}
@@ -543,7 +543,7 @@ void MjpegServerImpl::ConnThread::SendJSON(wpi::raw_ostream& os,
for (char ch : *choice) {
ch_name.push_back(std::isprint(ch) ? ch : ' ');
}
fmt::print(os, "\"{}\": \"{}\"", j, ch_name);
fmt::print(os, "\"{}\": \"{}\"", j, ch_name.str());
}
os << "}\n";
}