mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
cli: ssh-cache stylistic changes
This commit is contained in:
@ -50,7 +50,7 @@ const CacheEntry = struct {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
return CacheEntry{
|
return .{
|
||||||
.hostname = hostname,
|
.hostname = hostname,
|
||||||
.timestamp = timestamp,
|
.timestamp = timestamp,
|
||||||
.terminfo_version = terminfo_version,
|
.terminfo_version = terminfo_version,
|
||||||
@ -107,9 +107,8 @@ fn isValidHostname(host: []const u8) bool {
|
|||||||
var has_colon = false;
|
var has_colon = false;
|
||||||
for (ipv6_part) |c| {
|
for (ipv6_part) |c| {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
'a'...'f', 'A'...'F', '0'...'9', ':' => {
|
'a'...'f', 'A'...'F', '0'...'9' => {},
|
||||||
if (c == ':') has_colon = true;
|
':' => has_colon = true,
|
||||||
},
|
|
||||||
else => return false,
|
else => return false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,7 +177,7 @@ fn readCacheFile(
|
|||||||
const gop = try entries.getOrPut(hostname_copy);
|
const gop = try entries.getOrPut(hostname_copy);
|
||||||
if (!gop.found_existing) {
|
if (!gop.found_existing) {
|
||||||
const terminfo_copy = try alloc.dupe(u8, entry.terminfo_version);
|
const terminfo_copy = try alloc.dupe(u8, entry.terminfo_version);
|
||||||
gop.value_ptr.* = CacheEntry{
|
gop.value_ptr.* = .{
|
||||||
.hostname = hostname_copy,
|
.hostname = hostname_copy,
|
||||||
.timestamp = entry.timestamp,
|
.timestamp = entry.timestamp,
|
||||||
.terminfo_version = terminfo_copy,
|
.terminfo_version = terminfo_copy,
|
||||||
|
Reference in New Issue
Block a user