1
0
Fork 0

commit treeson with the ground

This commit is contained in:
namedkitten 2020-07-10 03:25:23 +01:00
parent 8d6a7df569
commit 9cd3a3ceeb
2 changed files with 5 additions and 9 deletions

View file

@ -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();

View file

@ -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;