summaryrefslogtreecommitdiff
path: root/src/cli/ssh_cache.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-07-09 06:47:15 -0700
committerMitchell Hashimoto <m@mitchellh.com>2025-07-09 06:47:17 -0700
commit7cfb026e84ae1d93d123a8b42930b152b4fb9305 (patch)
tree5a7d9f2b8c34234347409baf122d096e2cba6971 /src/cli/ssh_cache.zig
parentbcb4e624a45a647b9001994a0fe84500b28cc4c5 (diff)
cli: ssh-cache stylistic changes
Diffstat (limited to 'src/cli/ssh_cache.zig')
-rw-r--r--src/cli/ssh_cache.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cli/ssh_cache.zig b/src/cli/ssh_cache.zig
index 468fc7b3c..2912addc1 100644
--- a/src/cli/ssh_cache.zig
+++ b/src/cli/ssh_cache.zig
@@ -50,7 +50,7 @@ const CacheEntry = struct {
return null;
};
- return CacheEntry{
+ return .{
.hostname = hostname,
.timestamp = timestamp,
.terminfo_version = terminfo_version,
@@ -107,9 +107,8 @@ fn isValidHostname(host: []const u8) bool {
var has_colon = false;
for (ipv6_part) |c| {
switch (c) {
- 'a'...'f', 'A'...'F', '0'...'9', ':' => {
- if (c == ':') has_colon = true;
- },
+ 'a'...'f', 'A'...'F', '0'...'9' => {},
+ ':' => has_colon = true,
else => return false,
}
}
@@ -178,7 +177,7 @@ fn readCacheFile(
const gop = try entries.getOrPut(hostname_copy);
if (!gop.found_existing) {
const terminfo_copy = try alloc.dupe(u8, entry.terminfo_version);
- gop.value_ptr.* = CacheEntry{
+ gop.value_ptr.* = .{
.hostname = hostname_copy,
.timestamp = entry.timestamp,
.terminfo_version = terminfo_copy,