Skip to content

Commit

Permalink
fix: migrate to new truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanaasagi committed Jun 30, 2023
1 parent fbb11d4 commit 20930eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn slugifyAlloc(allocator: Allocator, s: []const u8, options: Options) ![]co
}
}
if (codepoint < 0x7F) {
try pushChar(@truncate(u8, codepoint), out, &prev_is_dash, options.sep);
try pushChar(@truncate(codepoint), out, &prev_is_dash, options.sep);
} else {
const res = deuni.getReplacement(codepoint) orelse options.sep;
for (res) |c| {
Expand All @@ -79,7 +79,7 @@ pub fn slugify(dest: []u8, s: []const u8, options: Options) ![]const u8 {

while (iter.nextCodepoint()) |codepoint| {
if (codepoint < 0x7F) {
try pushChar(@truncate(u8, codepoint), out, &prev_is_dash, options.sep);
try pushChar(@truncate(codepoint), out, &prev_is_dash, options.sep);
} else {
const res = deuni.getReplacement(codepoint) orelse options.sep;
for (res) |c| {
Expand Down

0 comments on commit 20930eb

Please sign in to comment.