| ... | ... | @@ -270,11 +270,9 @@ const FmtError = error{ |
| 270 | 270 | FileBusy, |
| 271 | 271 | } || fs.File.OpenError; |
| 272 | 272 | |
| 273 | | fn fmtPath(fmt: *Fmt, file_path_ref: []const u8, check_mode: bool) FmtError!void { |
| 274 | | const file_path = try std.mem.dupe(fmt.allocator, u8, file_path_ref); |
| 275 | | defer fmt.allocator.free(file_path); |
| 276 | | |
| 277 | | if (try fmt.seen.put(file_path, {})) |_| return; |
| 273 | fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool) FmtError!void { |
| 274 | if (fmt.seen.exists(file_path)) return; |
| 275 | try fmt.seen.put(file_path); |
| 278 | 276 | |
| 279 | 277 | const source_code = io.readFileAlloc(fmt.allocator, file_path) catch |err| switch (err) { |
| 280 | 278 | error.IsDir, error.AccessDenied => { |
| ... | ... | @@ -341,7 +339,7 @@ const Fmt = struct { |
| 341 | 339 | color: errmsg.Color, |
| 342 | 340 | allocator: *mem.Allocator, |
| 343 | 341 | |
| 344 | | const SeenMap = std.StringHashMap(void); |
| 342 | const SeenMap = std.BufSet; |
| 345 | 343 | }; |
| 346 | 344 | |
| 347 | 345 | fn printErrMsgToFile( |