mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 04:42:30 -04:00
chore: make declarations private if they don't need to be public
This change is 99% s/pub// + a handful of dead code removal.
This commit is contained in:
303 files changed
+1561
-1766
No files matched your search
+2
-10
@@ -522,15 +522,6 @@ pub fn Builder(comptime commands: anytype) type {
|
||||
return error.UnknownCommand;
|
||||
}
|
||||
|
||||
/// Returns the type for validator function.
|
||||
pub fn ValidatorFn(comptime T: type, comptime is_multiple: bool) type {
|
||||
if (is_multiple) {
|
||||
return *const fn (Allocator, *std.process.Args.Iterator, *std.ArrayList(T)) anyerror!void;
|
||||
}
|
||||
|
||||
return *const fn (Allocator, *std.process.Args.Iterator, *T) anyerror!void;
|
||||
}
|
||||
|
||||
/// Turns a snake_case string to kebab-case in comptime.
|
||||
fn toKebabCase(comptime str: []const u8) [str.len]u8 {
|
||||
var output: [str.len]u8 = str[0..str.len].*;
|
||||
@@ -572,7 +563,8 @@ pub fn Builder(comptime commands: anytype) type {
|
||||
/// .field_name = "struct_field_name",
|
||||
/// .type = T, // or .{ .cli = T, .memory = T }
|
||||
/// .multiple = ?bool,
|
||||
/// .validator = ?ValidatorFn(T, is_multiple),
|
||||
/// // *ArrayList(T) instead of *T when `.multiple`
|
||||
/// .validator = ?*const fn (Allocator, *std.process.Args.Iterator, *T) anyerror!void,
|
||||
/// };
|
||||
/// ```
|
||||
option: anytype,
|
||||
|
||||
Reference in new issue
Block a user