1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-07-30 14:43:05 +03:00

folly::to<std::string> -> fmt::format

Reviewed By: sharmafb

Differential Revision: D74672231

fbshipit-source-id: d8f4fc542de10f26cf06df7ca42518865e8bba3a
This commit is contained in:
Konstantin Tsoy
2025-05-14 08:46:52 -07:00
committed by Facebook GitHub Bot
parent 731de1fd72
commit 813f6a6cd1
30 changed files with 147 additions and 196 deletions

View File

@ -45,43 +45,37 @@ std::string optionalToString(const quic::Optional<quic::PacketNum>& packetNum) {
if (!packetNum) {
return "-";
}
return folly::to<std::string>(*packetNum);
return fmt::format("{}", *packetNum);
}
std::string largestAckScheduledToString(
const quic::QuicConnectionStateBase& conn) noexcept {
return folly::to<std::string>(
"[",
return fmt::format(
"[{},{},{}]",
optionalToString(
conn.ackStates.initialAckState
? conn.ackStates.initialAckState->largestAckScheduled
: std::nullopt),
",",
optionalToString(
conn.ackStates.handshakeAckState
? conn.ackStates.handshakeAckState->largestAckScheduled
: std::nullopt),
",",
optionalToString(conn.ackStates.appDataAckState.largestAckScheduled),
"]");
optionalToString(conn.ackStates.appDataAckState.largestAckScheduled));
}
std::string largestAckToSendToString(
const quic::QuicConnectionStateBase& conn) noexcept {
return folly::to<std::string>(
"[",
return fmt::format(
"[{},{},{}]",
optionalToString(
conn.ackStates.initialAckState
? largestAckToSend(*conn.ackStates.initialAckState)
: std::nullopt),
",",
optionalToString(
conn.ackStates.handshakeAckState
? largestAckToSend(*conn.ackStates.handshakeAckState)
: std::nullopt),
",",
optionalToString(largestAckToSend(conn.ackStates.appDataAckState)),
"]");
optionalToString(largestAckToSend(conn.ackStates.appDataAckState)));
}
using namespace quic;