fix: allocate file_type_name in file_type_config cache

This commit is contained in:
CJ van den Berg 2025-08-09 18:17:15 +02:00
parent 72d97f61f5
commit de6ca62f6d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -84,7 +84,7 @@ pub fn get(file_type_name: []const u8) !?@This() {
break :file_type if (syntax.FileType.get_by_name_static(file_type_name)) |ft| from_file_type(ft) else null;
}
};
try cache.put(cache_allocator, file_type_name, file_type);
try cache.put(cache_allocator, try cache_allocator.dupe(u8, file_type_name), file_type);
break :self file_type;
};
}