diff options
Diffstat (limited to 'vendor/libghostty-vt/src/lib/string.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/lib/string.zig | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/vendor/libghostty-vt/src/lib/string.zig b/vendor/libghostty-vt/src/lib/string.zig deleted file mode 100644 index 795823c2..00000000 --- a/vendor/libghostty-vt/src/lib/string.zig +++ /dev/null @@ -1,15 +0,0 @@ -const std = @import("std"); - -// This is a copy of std.mem.cutPrefix from 0.16. Once Ghostty has been ported -// to 0.16 this can be removed. - -/// If slice starts with prefix, returns the rest of slice starting at -/// prefix.len. -pub fn cutPrefix(comptime T: type, slice: []const T, prefix: []const T) ?[]const T { - return if (std.mem.startsWith(T, slice, prefix)) slice[prefix.len..] else null; -} - -test cutPrefix { - try std.testing.expectEqualStrings("foo", cutPrefix(u8, "--example=foo", "--example=").?); - try std.testing.expectEqual(null, cutPrefix(u8, "--example=foo", "-example=")); -} |
