@@ -203,22 +203,13 @@ pub const FileSystem = struct {
203203 // }
204204
205205 pub fn addEntry (dir : * DirEntry , entry : std.fs.IterableDir.Entry , allocator : std.mem.Allocator , comptime Iterator : type , iterator : Iterator ) ! void {
206- var _kind : Entry.Kind = undefined ;
207- switch (entry .kind ) {
208- .Directory = > {
209- _kind = Entry .Kind .dir ;
210- },
211- .SymLink = > {
212- // This might be wrong!
213- _kind = Entry .Kind .file ;
214- },
215- .File = > {
216- _kind = Entry .Kind .file ;
217- },
218- else = > {
219- return ;
220- },
221- }
206+ const _kind : Entry.Kind = switch (entry .kind ) {
207+ .Directory = > .dir ,
208+ // This might be wrong!
209+ .SymLink = > .file ,
210+ .File = > .file ,
211+ else = > return ,
212+ };
222213 // entry.name only lives for the duration of the iteration
223214
224215 const name = if (entry .name .len >= strings .StringOrTinyString .Max )
@@ -231,22 +222,20 @@ pub const FileSystem = struct {
231222 else
232223 strings .StringOrTinyString .initLowerCase (entry .name );
233224
234- var stored = try EntryStore .instance .append (
235- Entry {
236- .base_ = name ,
237- .base_lowercase_ = name_lowercased ,
238- .dir = dir .dir ,
239- .mutex = Mutex .init (),
240- // Call "stat" lazily for performance. The "@material-ui/icons" package
241- // contains a directory with over 11,000 entries in it and running "stat"
242- // for each entry was a big performance issue for that package.
243- .need_stat = entry .kind == .SymLink ,
244- .cache = Entry.Cache {
245- .symlink = PathString .empty ,
246- .kind = _kind ,
247- },
225+ const stored = try EntryStore .instance .append (.{
226+ .base_ = name ,
227+ .base_lowercase_ = name_lowercased ,
228+ .dir = dir .dir ,
229+ .mutex = Mutex .init (),
230+ // Call "stat" lazily for performance. The "@material-ui/icons" package
231+ // contains a directory with over 11,000 entries in it and running "stat"
232+ // for each entry was a big performance issue for that package.
233+ .need_stat = entry .kind == .SymLink ,
234+ .cache = .{
235+ .symlink = PathString .empty ,
236+ .kind = _kind ,
248237 },
249- );
238+ } );
250239
251240 const stored_name = stored .base ();
252241
@@ -270,7 +259,7 @@ pub const FileSystem = struct {
270259 Output .prettyln ("\n {s}" , .{dir });
271260 }
272261
273- return DirEntry { .dir = dir , .data = EntryMap {} };
262+ return . { .dir = dir , .data = . {} };
274263 }
275264
276265 pub const Err = struct {
@@ -363,7 +352,7 @@ pub const FileSystem = struct {
363352 };
364353
365354 pub const Entry = struct {
366- cache : Cache = Cache {},
355+ cache : Cache = . {},
367356 dir : string ,
368357
369358 base_ : strings.StringOrTinyString ,
@@ -406,7 +395,7 @@ pub const FileSystem = struct {
406395 pub const Cache = struct {
407396 symlink : PathString = PathString .empty ,
408397 fd : StoredFileDescriptorType = 0 ,
409- kind : Kind = Kind .file ,
398+ kind : Kind = .file ,
410399 };
411400
412401 pub const Kind = enum {
0 commit comments