fix: add renames

This commit is contained in:
LordMZTE 2023-03-13 23:28:36 +01:00
parent afda305c27
commit d54c3149d3
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -157,18 +157,21 @@ fn runServer() !void {
defer alloc.free(req.str); defer alloc.free(req.str);
if (mappings.get(req.str)) |mapping| { if (mappings.get(req.str)) |mapping| {
const res = StringPacket{ .str = mapping.mapped }; const renamed = renames.get(mapping.mapped);
const res = StringPacket{ .str = renamed orelse mapping.mapped };
try res.write(con.stream.writer()); try res.write(con.stream.writer());
std.log.info( std.log.info(
\\ \\
\\ Unmapped: {s} \\ Unmapped: {s}
\\ Mapped: {s} \\ Mapped: {s}
\\ Renamed: {s}
\\ \\
\\ Doc: {s} \\ Doc: {s}
, .{ , .{
req.str, req.str,
mapping.mapped, mapping.mapped,
renamed orelse "<no rename>",
mapping.doc orelse "<no docs>", mapping.doc orelse "<no docs>",
}); });
} else { } else {