fix: add renames
This commit is contained in:
parent
afda305c27
commit
d54c3149d3
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue