Skip to content

Commit e77c3cd

Browse files
committed
Upgrade to fmt v10; fix access to c_str in wld
1 parent eb63c00 commit e77c3cd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/colors.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <logger.hpp>
99
#include <map>
1010
#include <string>
11+
#include <fmt/core.h>
1112

1213
using nlohmann::json;
1314
using std::list;
@@ -220,7 +221,7 @@ void from_json(const json &j, Palette &p);
220221

221222
} // namespace Colors
222223

223-
template <> struct fmt::formatter<Colors::Color> {
224+
template <> struct fmt::formatter<Colors::Color> : formatter<string_view> {
224225
char presentation = 'c';
225226
constexpr auto parse(format_parse_context &ctx) {
226227
auto it = ctx.begin(), end = ctx.end();
@@ -236,8 +237,7 @@ template <> struct fmt::formatter<Colors::Color> {
236237
return it;
237238
}
238239

239-
template <typename FormatContext>
240-
auto format(const Colors::Color &c, FormatContext &ctx) {
240+
auto format(const Colors::Color &c, format_context &ctx) const {
241241
if (c.ALPHA == 0xff)
242242
return format_to(ctx.out(), "#{:02x}{:02x}{:02x}", c.R, c.G, c.B);
243243
else

src/worldloader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void Data::loadChunk(const ChunkCoordinates coords) {
9898
if (!nbt::parse(chunkBuffer, length, data) || !Chunk::assert_chunk(data)) {
9999
fclose(regionHandle);
100100
logger::trace("Chunk parsing failed for chunk {} {} in {}", coords.x,
101-
coords.z, regionFile.c_str());
101+
coords.z, regionFile.string());
102102
return;
103103
}
104104

0 commit comments

Comments
 (0)