mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilibc] Use std::string_view instead of Twine (#3380)
Use fmtlib where needed for string formatting into std::string_view.
This commit is contained in:
@@ -4,11 +4,13 @@
|
||||
|
||||
#include "frc2/command/WaitCommand.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
WaitCommand::WaitCommand(units::second_t duration) : m_duration{duration} {
|
||||
auto durationStr = std::to_string(duration.to<double>());
|
||||
SetName(wpi::Twine(GetName()) + ": " + wpi::Twine(durationStr) + " seconds");
|
||||
SetName(fmt::format("{}: {} seconds", GetName(), durationStr));
|
||||
}
|
||||
|
||||
void WaitCommand::Initialize() {
|
||||
|
||||
Reference in New Issue
Block a user