mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
UICommon: Make use of fmt where applicable
Continues the migration to using fmt. Notably, this allows safely converting a map within USBUtils over to containing string view instances, rather than std::string instances, as fmt safely handles the formatting of string views.
This commit is contained in:
@ -4,9 +4,6 @@
|
||||
|
||||
#include "UICommon/DiscordPresence.h"
|
||||
|
||||
#include "Common/Hash.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/Config/UISettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
@ -16,9 +13,14 @@
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <ctime>
|
||||
#include <discord-rpc/include/discord_rpc.h>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include <discord-rpc/include/discord_rpc.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "Common/Hash.h"
|
||||
|
||||
#endif
|
||||
|
||||
namespace Discord
|
||||
@ -39,7 +41,7 @@ void HandleDiscordJoinRequest(const DiscordUser* user)
|
||||
if (event_handler == nullptr)
|
||||
return;
|
||||
|
||||
const std::string discord_tag = StringFromFormat("%s#%s", user->username, user->discriminator);
|
||||
const std::string discord_tag = fmt::format("{}#{}", user->username, user->discriminator);
|
||||
event_handler->DiscordJoinRequest(user->userId, discord_tag, user->avatar);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user