Skip to content

Commit dfd6966

Browse files
authored
fix(var): 用显式类型代替 "var" (IDE0008)
2 parents 8844155 + c5d51f5 commit dfd6966

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ghv/Command/Help.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ internal class Help
66
{
77
public static void Show()
88
{
9-
var table = new Table();
9+
Table table = new Table();
1010
table.AddColumn("命令");
1111
table.AddColumn("作用");
1212
table.AddColumn("参数");

ghv/Command/User.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ private static async Task FetchAndDisplayUserInfo(string username)
6767
return;
6868
}
6969

70-
var table = new Table();
70+
Table table = new Table();
7171
table.Border(TableBorder.Rounded);
7272
table.BorderColor(Color.Grey);
7373
table.AddColumn(new TableColumn("属性").Centered());
7474
table.AddColumn(new TableColumn("值").Centered());
7575

76-
var propertiesToDisplay = new List<string> { "login", "name", "company", "blog", "location", "email", "bio", "twitter_username" };
77-
var propertyTranslations = new Dictionary<string, string>
76+
List<string> propertiesToDisplay = new List<string> { "login", "name", "company", "blog", "location", "email", "bio", "twitter_username" };
77+
Dictionary<string, string> propertyTranslations = new Dictionary<string, string>
7878
{
7979
{ "login", "登录名" },
8080
{ "name", "姓名" },
@@ -94,7 +94,7 @@ private static async Task FetchAndDisplayUserInfo(string username)
9494
table.AddRow("姓名", combinedName).Border(TableBorder.Square);
9595
}
9696

97-
foreach (var property in jsonNode.AsObject())
97+
foreach (KeyValuePair<string, JsonNode?> property in jsonNode.AsObject())
9898
{
9999
if (propertiesToDisplay.Contains(property.Key) && property.Key != "login" && property.Key != "name")
100100
{

0 commit comments

Comments
 (0)