commit treeson with the ground
This commit is contained in:
parent
8d6a7df569
commit
9cd3a3ceeb
13
src/main.zig
13
src/main.zig
|
@ -25,14 +25,11 @@ pub fn main() !void {
|
|||
var br = Bar.init(&bar);
|
||||
|
||||
const widgets = [_]*Widget{
|
||||
&Widget.init(&textWidget.New("owo", "potato")),
|
||||
&Widget.init(&textWidget.New("uwu", "tomato")),
|
||||
&Widget.init(&weatherWidget.New(allocator, &br, "London")),
|
||||
&Widget.init(&batteryWidget.New(allocator, &br)),
|
||||
&Widget.init(&timeWidget.New(allocator, &br)),
|
||||
|
||||
//&Widget.init(&weatherWidget.New(allocator, &br, "Oxford")),
|
||||
//&Widget.init(&weatherWidget.New(allocator, &br, "Newcastle")),
|
||||
&Widget.init(&textWidget.New("owo", "potato")), // 4KiB
|
||||
&Widget.init(&textWidget.New("uwu", "tomato")), // 4KiB
|
||||
&Widget.init(&weatherWidget.New(allocator, &br, "London")), // 16KiB
|
||||
&Widget.init(&batteryWidget.New(allocator, &br)), // 756.15KiB
|
||||
&Widget.init(&timeWidget.New(allocator, &br)), // 32.46KiB
|
||||
};
|
||||
bar.widgets = widgets[0..];
|
||||
try br.start();
|
||||
|
|
|
@ -53,7 +53,6 @@ pub const BatteryWidget = struct {
|
|||
return self.initial_info();
|
||||
}
|
||||
pub fn get_power_paths(self: *BatteryWidget, provided_allocator: *std.mem.Allocator) anyerror!PowerPaths {
|
||||
// remember that PowerPaths fields are allocated with self.allocator and will need to be freed seporately
|
||||
var arena = std.heap.ArenaAllocator.init(provided_allocator);
|
||||
defer arena.deinit();
|
||||
var allocator = &arena.allocator;
|
||||
|
|
Loading…
Reference in a new issue