From f948dc1f78530f586c0386ec5b64da5f2356b2a9 Mon Sep 17 00:00:00 2001 From: Kirk Scheibelhut Date: Tue, 18 Jul 2023 13:33:08 -0700 Subject: [PATCH] doesn't need to be pub --- src/tools/copies.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/copies.zig b/src/tools/copies.zig index 55459af8..8064625b 100644 --- a/src/tools/copies.zig +++ b/src/tools/copies.zig @@ -53,6 +53,11 @@ pub fn main() !void { } } +fn cut(haystack: []const u8, needle: []const u8) ?struct { []const u8, []const u8 } { + const index = std.mem.indexOf(u8, haystack, needle) orelse return null; + return .{ haystack[0..index], haystack[index + needle.len ..] }; +} + fn extractFuncName(define: []const u8, buf: []u8) ?[]const u8 { const func_name = (cut(define, "@") orelse return null)[1]; var buf_count: usize = 0; @@ -124,8 +129,3 @@ test "extractMemcpySize" { \\ call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %4, i64 %6, i1 false) , 0); } - -pub fn cut(haystack: []const u8, needle: []const u8) ?struct { []const u8, []const u8 } { - const index = std.mem.indexOf(u8, haystack, needle) orelse return null; - return .{ haystack[0..index], haystack[index + needle.len ..] }; -}