mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
fix Blob#slice return type
This commit is contained in:
@@ -230,7 +230,7 @@ pub fn getSlice(
|
|||||||
maybe_end: ?i32,
|
maybe_end: ?i32,
|
||||||
maybe_content_type: ?[]const u8,
|
maybe_content_type: ?[]const u8,
|
||||||
page: *Page,
|
page: *Page,
|
||||||
) !Blob {
|
) !*Blob {
|
||||||
const mime: []const u8 = blk: {
|
const mime: []const u8 = blk: {
|
||||||
if (maybe_content_type) |content_type| {
|
if (maybe_content_type) |content_type| {
|
||||||
if (content_type.len == 0) {
|
if (content_type.len == 0) {
|
||||||
@@ -265,10 +265,18 @@ pub fn getSlice(
|
|||||||
break :blk slice.len;
|
break :blk slice.len;
|
||||||
};
|
};
|
||||||
|
|
||||||
return .{ .slice = slice[start..end], .mime = mime };
|
return page._factory.create(Blob{
|
||||||
|
._type = .generic,
|
||||||
|
.slice = slice[start..end],
|
||||||
|
.mime = mime,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return .{ .slice = slice, .mime = mime };
|
return page._factory.create(Blob{
|
||||||
|
._type = .generic,
|
||||||
|
.slice = slice,
|
||||||
|
.mime = mime,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the size of the Blob in bytes.
|
/// Returns the size of the Blob in bytes.
|
||||||
|
|||||||
Reference in New Issue
Block a user