Improves snake case conversion to better deal with acronyms
This commit is contained in:
parent
f1ad6a55de
commit
8c5a23e1a2
1 changed files with 1 additions and 1 deletions
|
|
@ -923,7 +923,7 @@ fn writeFieldName(writer: anytype, name: []const u8) !void {
|
||||||
},
|
},
|
||||||
'a'...'z' => try writer.writeByte(c),
|
'a'...'z' => try writer.writeByte(c),
|
||||||
'A'...'Z' => {
|
'A'...'Z' => {
|
||||||
if (i > 0) switch (name[i - 1]) {
|
if (i > 0 and i < name.len - 1) switch (name[i + 1]) {
|
||||||
'A'...'Z', '_' => {},
|
'A'...'Z', '_' => {},
|
||||||
else => try writer.writeByte('_'),
|
else => try writer.writeByte('_'),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue