mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-12 10:06:12 -04:00
Remove unused imports
As a general rule, I keep `std` if its there and unused, mostly for debug.print debugging.
This commit is contained in:
@@ -30,7 +30,6 @@ const EventTarget = @import("webapi/EventTarget.zig");
|
||||
const Element = @import("webapi/Element.zig");
|
||||
|
||||
const log = lp.log;
|
||||
const String = lp.String;
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
// Re-export types from EventManagerBase for API compatibility
|
||||
|
||||
@@ -21,10 +21,8 @@ const lp = @import("lightpanda");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
const URL = @import("URL.zig");
|
||||
const Config = @import("../Config.zig");
|
||||
const Notification = @import("../Notification.zig");
|
||||
const CookieJar = @import("webapi/storage/Cookie.zig").Jar;
|
||||
const WebSocket = @import("webapi/net/WebSocket.zig");
|
||||
|
||||
const http = @import("../network/http.zig");
|
||||
const Network = @import("../network/Network.zig");
|
||||
|
||||
@@ -25,7 +25,6 @@ const MouseEvent = @import("webapi/event/MouseEvent.zig");
|
||||
const KeyboardEvent = @import("webapi/event/KeyboardEvent.zig");
|
||||
const Frame = @import("Frame.zig");
|
||||
const Session = @import("Session.zig");
|
||||
const Selector = @import("webapi/selector/Selector.zig");
|
||||
|
||||
fn dispatchInputAndChangeEvents(el: *Element, frame: *Frame) !void {
|
||||
const input_evt: *Event = try .initTrusted(comptime .wrap("input"), .{ .bubbles = true }, frame._page);
|
||||
|
||||
@@ -23,7 +23,6 @@ const string = @import("../../string.zig");
|
||||
const Frame = @import("../Frame.zig");
|
||||
const Page = @import("../Page.zig");
|
||||
const Session = @import("../Session.zig");
|
||||
const WorkerGlobalScope = @import("../webapi/WorkerGlobalScope.zig");
|
||||
|
||||
const js = @import("js.zig");
|
||||
const Local = @import("Local.zig");
|
||||
|
||||
@@ -20,7 +20,6 @@ const std = @import("std");
|
||||
const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("js.zig");
|
||||
const bridge = @import("bridge.zig");
|
||||
const Env = @import("Env.zig");
|
||||
const Origin = @import("Origin.zig");
|
||||
const Scheduler = @import("Scheduler.zig");
|
||||
|
||||
@@ -25,7 +25,6 @@ const bridge = @import("bridge.zig");
|
||||
const Context = @import("Context.zig");
|
||||
const Isolate = @import("Isolate.zig");
|
||||
const Platform = @import("Platform.zig");
|
||||
const Snapshot = @import("Snapshot.zig");
|
||||
const Inspector = @import("Inspector.zig");
|
||||
|
||||
const App = @import("../../App.zig");
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
const std = @import("std");
|
||||
const js = @import("js.zig");
|
||||
|
||||
const Session = @import("../Session.zig");
|
||||
|
||||
const v8 = js.v8;
|
||||
|
||||
const Identity = @This();
|
||||
|
||||
@@ -33,7 +33,6 @@ const TaggedOpaque = @import("TaggedOpaque.zig");
|
||||
const v8 = js.v8;
|
||||
const log = lp.log;
|
||||
const CallOpts = Caller.CallOpts;
|
||||
const IS_DEBUG = @import("builtin").mode == .Debug;
|
||||
|
||||
// Where js.Context has a lifetime tied to the frame, and holds the
|
||||
// v8::Global<v8::Context>, this has a much shorter lifetime and holds a
|
||||
|
||||
@@ -21,7 +21,6 @@ const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("js.zig");
|
||||
const bridge = @import("bridge.zig");
|
||||
const WebDriver = @import("../webapi/WebDriver.zig");
|
||||
|
||||
const v8 = js.v8;
|
||||
const log = lp.log;
|
||||
|
||||
@@ -21,7 +21,6 @@ const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("js.zig");
|
||||
const Frame = @import("../Frame.zig");
|
||||
const Session = @import("../Session.zig");
|
||||
|
||||
const v8 = js.v8;
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ const Node = @import("Node.zig");
|
||||
const Range = @import("Range.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
const IS_DEBUG = @import("builtin").mode == .Debug;
|
||||
|
||||
const AbstractRange = @This();
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ const EventTarget = @import("EventTarget.zig");
|
||||
|
||||
const String = lp.String;
|
||||
const Allocator = std.mem.Allocator;
|
||||
const IS_DEBUG = @import("builtin").mode == .Debug;
|
||||
|
||||
pub const Event = @This();
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ const Page = @import("../Page.zig");
|
||||
const EventManager = @import("../EventManager.zig");
|
||||
|
||||
const Event = @import("Event.zig");
|
||||
const WorkerGlobalScope = @import("WorkerGlobalScope.zig");
|
||||
|
||||
const RegisterOptions = EventManager.RegisterOptions;
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ const DOMRect = @import("DOMRect.zig");
|
||||
|
||||
const log = lp.log;
|
||||
const Allocator = std.mem.Allocator;
|
||||
const IS_DEBUG = @import("builtin").mode == .Debug;
|
||||
|
||||
pub fn registerTypes() []const type {
|
||||
return &.{
|
||||
|
||||
@@ -20,7 +20,6 @@ const std = @import("std");
|
||||
const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("../js/js.zig");
|
||||
const Frame = @import("../Frame.zig");
|
||||
const h5e = @import("../parser/html5ever.zig");
|
||||
|
||||
const String = lp.String;
|
||||
|
||||
@@ -29,7 +29,6 @@ const Element = @import("Element.zig");
|
||||
const log = lp.log;
|
||||
const String = lp.String;
|
||||
const Allocator = std.mem.Allocator;
|
||||
const IS_DEBUG = @import("builtin").mode == .Debug;
|
||||
|
||||
pub fn registerTypes() []const type {
|
||||
return &.{
|
||||
|
||||
@@ -21,7 +21,6 @@ const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("../js/js.zig");
|
||||
const Frame = @import("../Frame.zig");
|
||||
const Session = @import("../Session.zig");
|
||||
|
||||
const Node = @import("Node.zig");
|
||||
const DocumentFragment = @import("DocumentFragment.zig");
|
||||
|
||||
@@ -20,7 +20,6 @@ const std = @import("std");
|
||||
const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("../js/js.zig");
|
||||
const http = @import("../../network/http.zig");
|
||||
|
||||
const URL = @import("../URL.zig");
|
||||
const Frame = @import("../Frame.zig");
|
||||
|
||||
@@ -23,6 +23,7 @@ const Page = @import("../../Page.zig");
|
||||
const Frame = @import("../../Frame.zig");
|
||||
|
||||
const Node = @import("../Node.zig");
|
||||
|
||||
const GenericIterator = @import("iterator.zig").Entry;
|
||||
|
||||
// Optimized for node.childNodes, which has to be a live list.
|
||||
|
||||
@@ -21,9 +21,6 @@ const lp = @import("lightpanda");
|
||||
|
||||
const js = @import("../../js/js.zig");
|
||||
const Page = @import("../../Page.zig");
|
||||
const Frame = @import("../../Frame.zig");
|
||||
|
||||
const Execution = js.Execution;
|
||||
|
||||
pub fn Entry(comptime Inner: type, comptime field: ?[]const u8) type {
|
||||
const R = reflect(Inner, field);
|
||||
|
||||
@@ -31,8 +31,6 @@ const Canvas = @This();
|
||||
_proto: *HtmlElement,
|
||||
_cached: ?DrawingContext = null,
|
||||
|
||||
const ContextType = enum { none, @"2d", webgl };
|
||||
|
||||
pub fn asElement(self: *Canvas) *Element {
|
||||
return self._proto._proto;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
const std = @import("std");
|
||||
const js = @import("../../../js/js.zig");
|
||||
const URL = @import("../../../URL.zig");
|
||||
const Frame = @import("../../../Frame.zig");
|
||||
|
||||
const Node = @import("../../Node.zig");
|
||||
|
||||
@@ -23,7 +23,6 @@ const Document = @import("../../Document.zig");
|
||||
const Node = @import("../../Node.zig");
|
||||
const Element = @import("../../Element.zig");
|
||||
const HtmlElement = @import("../Html.zig");
|
||||
const URL = @import("../../URL.zig");
|
||||
|
||||
const IFrame = @This();
|
||||
_proto: *HtmlElement,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const std = @import("std");
|
||||
const js = @import("../../../js/js.zig");
|
||||
const Frame = @import("../../../Frame.zig");
|
||||
const URL = @import("../../../URL.zig");
|
||||
const Node = @import("../../Node.zig");
|
||||
const Element = @import("../../Element.zig");
|
||||
const HtmlElement = @import("../Html.zig");
|
||||
|
||||
@@ -20,7 +20,6 @@ const std = @import("std");
|
||||
const js = @import("../../../js/js.zig");
|
||||
const Frame = @import("../../../Frame.zig");
|
||||
|
||||
const URL = @import("../../URL.zig");
|
||||
const Node = @import("../../Node.zig");
|
||||
const Element = @import("../../Element.zig");
|
||||
const HtmlElement = @import("../Html.zig");
|
||||
|
||||
@@ -23,7 +23,6 @@ const Frame = @import("../../../Frame.zig");
|
||||
const Node = @import("../../Node.zig");
|
||||
const Element = @import("../../Element.zig");
|
||||
const HtmlElement = @import("../Html.zig");
|
||||
const URL = @import("../../URL.zig");
|
||||
|
||||
const Script = @This();
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ const js = @import("../../js/js.zig");
|
||||
const http = @import("../../../network/http.zig");
|
||||
|
||||
const URL = @import("../URL.zig");
|
||||
const Frame = @import("../../Frame.zig");
|
||||
const Headers = @import("Headers.zig");
|
||||
const Blob = @import("../Blob.zig");
|
||||
const AbortSignal = @import("../AbortSignal.zig");
|
||||
|
||||
const Execution = js.Execution;
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
const std = @import("std");
|
||||
|
||||
const Frame = @import("../../Frame.zig");
|
||||
|
||||
const Node = @import("../Node.zig");
|
||||
const Attribute = @import("../element/Attribute.zig");
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ const Session = @import("browser/Session.zig");
|
||||
const Cookie = @import("browser/webapi/storage/Cookie.zig");
|
||||
|
||||
const log = lp.log;
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
/// Load cookies from a JSON file into the cookie jar.
|
||||
/// The file format is an array of objects with: name, value, domain, path,
|
||||
|
||||
3
src/network/cache/FsCache.zig
vendored
3
src/network/cache/FsCache.zig
vendored
@@ -20,7 +20,6 @@ const std = @import("std");
|
||||
const lp = @import("lightpanda");
|
||||
|
||||
const Cache = @import("Cache.zig");
|
||||
const Http = @import("../http.zig");
|
||||
|
||||
const log = lp.log;
|
||||
const CacheRequest = Cache.CacheRequest;
|
||||
@@ -89,7 +88,7 @@ pub fn deinit(self: *FsCache) void {
|
||||
self.dir.close();
|
||||
}
|
||||
|
||||
pub fn get(self: *FsCache, arena: std.mem.Allocator, req: CacheRequest) ?Cache.CachedResponse {
|
||||
pub fn get(self: *FsCache, arena: std.mem.Allocator, req: CacheRequest) ?CachedResponse {
|
||||
const hashed_key = hashKey(req.url);
|
||||
const cache_p = cachePath(&hashed_key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user