From 6ab7a9c88eec981fde8bf9af93d50f86af81ebd5 Mon Sep 17 00:00:00 2001 From: namedkitten Date: Thu, 23 Jul 2020 14:53:40 +0100 Subject: [PATCH] Format code. --- src/widgets/network/network.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/widgets/network/network.zig b/src/widgets/network/network.zig index c7d6873..828ad0a 100644 --- a/src/widgets/network/network.zig +++ b/src/widgets/network/network.zig @@ -37,18 +37,17 @@ fn toNetworkStatus(str: []const u8) NetworkStatus { } fn networkStatusToColour(s: NetworkStatus) []const u8 { - return switch(s) { + return switch (s) { .Connected => "green", .Disconnected => "red", - else => "darkest" + else => "darkest", }; } - pub const NetworkInfo = struct { network_type: NetworkType = .WiFi, network_status: NetworkStatus = .Connected, - network_info: [32]u8 = [32]u8{' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, + network_info: [32]u8 = [32]u8{ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, network_info_len: usize, }; @@ -131,7 +130,7 @@ pub const NetworkWidget = struct { try self.bar.add(Info{ .name = "network", - .full_text = try colour(allocator, networkStatusToColour(info.network_status), try std.fmt.allocPrint(allocator, "{} {}", .{@tagName(info.network_type), info.network_info[0..info.network_info_len]})), + .full_text = try colour(allocator, networkStatusToColour(info.network_status), try std.fmt.allocPrint(allocator, "{} {}", .{ @tagName(info.network_type), info.network_info[0..info.network_info_len] })), .markup = "pango", }); }