From 29f9a4e7e8a54d1549b9957ca7635f42d7bd9353 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Tue, 17 Oct 2023 12:10:18 +0200 Subject: [PATCH] fun :sparkles: --- .../Entities/Guild/AuditLog/DiscordAuditLogEntry.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/DisCatSharp/Entities/Guild/AuditLog/DiscordAuditLogEntry.cs b/DisCatSharp/Entities/Guild/AuditLog/DiscordAuditLogEntry.cs index 0793154d42..eeefb49446 100644 --- a/DisCatSharp/Entities/Guild/AuditLog/DiscordAuditLogEntry.cs +++ b/DisCatSharp/Entities/Guild/AuditLog/DiscordAuditLogEntry.cs @@ -56,10 +56,7 @@ public class DiscordAuditLogEntry : SnowflakeObject /// Thrown when the is not compatible with the targets type. public T? As() where T : AuditLogChangeSet - { - if (this is T { IsValid: true } toConvert) - return toConvert; - - throw new InvalidCastException($"Cannot convert {this.GetType().Name} with action type {this.ActionType} to {typeof(T).Name}."); - } + => this is T { IsValid: true } toConvert + ? toConvert + : throw new InvalidCastException($"Cannot convert {this.GetType().Name} with action type {this.ActionType} to {typeof(T).Name}."); }