Skip to content

Commit

Permalink
Drop support for older versions of D and make safe (#30)
Browse files Browse the repository at this point in the history
Mostly reverts commit 2339eea
  • Loading branch information
slook authored Oct 15, 2024
1 parent 5863e49 commit f1586f4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions src/room.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Room
return room_list[roomname];
}

@trusted // .values doesn't work with @safe in old D versions
static Room[] rooms()
{
return room_list.values;
Expand All @@ -57,7 +56,6 @@ class Room
global_room_user_list.remove(username);
}

@trusted // .keys doesn't work with @safe in old D versions
static string[] global_room_users()
{
return global_room_user_list.keys;
Expand Down Expand Up @@ -130,13 +128,11 @@ class Room
return user_list.length;
}

@trusted // .values doesn't work with @safe in old D versions
User[] users()
{
return user_list.values;
}

@trusted // .keys doesn't work with @safe in old D versions
private string[] user_names()
{
return user_list.keys;
Expand Down
1 change: 0 additions & 1 deletion src/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ class Server
return null;
}

@trusted // .keys doesn't work with @safe in old D versions
User[] users()
{
return user_list.values;
Expand Down
10 changes: 1 addition & 9 deletions src/soulsetup.d
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,12 @@ class Menu
actions[index] = action;
}

@trusted // .keys doesn't work with @safe in old D versions
string[] sorted_entry_indexes()
{
auto indexes = entries.keys;
sort(indexes);
return indexes;
}

void show()
{
writefln("\n%s\n", title);
if (info.length > 0) writefln("%s\n", info);

foreach (index ; sorted_entry_indexes)
foreach (index ; sort(entries.keys))
writefln("%s. %s", index, entries[index]);

write("\nYour choice : ");
Expand Down

0 comments on commit f1586f4

Please sign in to comment.