Skip to content

Commit 0ffc701

Browse files
committed
Remove all inlines
Following Zig recommendation not to inline except in specific cases, none of which I think applies to use. Also, mimalloc.create can't fail (it used to be possible, but that changed a while ago), so removed its error return.
1 parent 17bebf4 commit 0ffc701

File tree

7 files changed

+57
-62
lines changed

7 files changed

+57
-62
lines changed

src/browser/css/libdom.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const MatcherTest = struct {
140140
test "Browser.CSS.Libdom: matchFirst" {
141141
const alloc = std.testing.allocator;
142142

143-
try parser.init();
143+
parser.init();
144144
defer parser.deinit();
145145

146146
var matcher = MatcherTest.init(alloc);
@@ -285,7 +285,7 @@ test "Browser.CSS.Libdom: matchFirst" {
285285
test "Browser.CSS.Libdom: matchAll" {
286286
const alloc = std.testing.allocator;
287287

288-
try parser.init();
288+
parser.init();
289289
defer parser.deinit();
290290

291291
var matcher = MatcherTest.init(alloc);

src/browser/dump.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn writeEscapedAttributeValue(writer: anytype, value: []const u8) !void {
226226

227227
const testing = std.testing;
228228
test "dump.writeHTML" {
229-
try parser.init();
229+
parser.init();
230230
defer parser.deinit();
231231

232232
try testWriteHTML(

src/browser/mimalloc.zig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@ const c = @cImport({
2626
@cInclude("mimalloc.h");
2727
});
2828

29-
const Error = error{
30-
HeapNotNull,
31-
HeapNull,
32-
};
33-
3429
var heap: ?*c.mi_heap_t = null;
3530

36-
pub fn create() Error!void {
31+
pub fn create() void {
3732
std.debug.assert(heap == null);
3833
heap = c.mi_heap_new();
3934
std.debug.assert(heap != null);

src/browser/mime.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub const Mime = struct {
5555
};
5656

5757
/// Returns the null-terminated charset value.
58-
pub inline fn charsetString(mime: *const Mime) [:0]const u8 {
58+
pub fn charsetString(mime: *const Mime) [:0]const u8 {
5959
return @ptrCast(&mime.charset);
6060
}
6161

0 commit comments

Comments
 (0)