File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ pub const ConfigLoader = struct {
5252 self : * ConfigLoader ,
5353 options : types.LoadOptions ,
5454 ) ! types.UntypedConfigResult {
55- var sources = std .ArrayList (types .SourceInfo ){} ;
55+ var sources = std .ArrayList (types .SourceInfo ). empty ;
5656 try sources .ensureTotalCapacity (self .allocator , 4 );
5757 defer sources .deinit (self .allocator );
5858
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ fn mergeArrays(
122122}
123123
124124fn cloneArray (allocator : std.mem.Allocator , arr : []std.json.Value ) ! []std.json.Value {
125- var result = std .ArrayList (std .json .Value ){} ;
125+ var result = std .ArrayList (std .json .Value ). empty ;
126126 try result .ensureTotalCapacity (allocator , arr .len );
127127 for (arr ) | item | {
128128 try result .append (allocator , try utils .cloneJsonValue (allocator , item ));
@@ -135,7 +135,7 @@ fn concatArrays(
135135 target : []std.json.Value ,
136136 source : []std.json.Value ,
137137) ! []std.json.Value {
138- var result = std .ArrayList (std .json .Value ){} ;
138+ var result = std .ArrayList (std .json .Value ). empty ;
139139 try result .ensureTotalCapacity (allocator , target .len + source .len );
140140
141141 // Add all target items
@@ -175,7 +175,7 @@ fn smartMergeArrays(
175175 return try concatArrays (allocator , target , source );
176176 };
177177
178- var result = std .ArrayList (std .json .Value ){} ;
178+ var result = std .ArrayList (std .json .Value ). empty ;
179179 try result .ensureTotalCapacity (allocator , target .len + source .len );
180180 var seen = std .StringHashMap (usize ).init (allocator );
181181 defer seen .deinit ();
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn fileExists(path: []const u8) bool {
1919
2020/// Strip single-line (//) and multi-line (/* */) comments from JSON content
2121fn stripJsonComments (allocator : std.mem.Allocator , content : []const u8 ) ! []const u8 {
22- var result = std .ArrayList (u8 ){} ;
22+ var result = std .ArrayList (u8 ). empty ;
2323 try result .ensureTotalCapacity (allocator , content .len );
2424 errdefer result .deinit (allocator );
2525
You can’t perform that action at this time.
0 commit comments