From 95fc691c563dfad6ba78ebc7b9b38f91171d7e86 Mon Sep 17 00:00:00 2001 From: Simon Oxtoby Date: Wed, 25 Sep 2024 12:35:09 +1000 Subject: [PATCH] Minor cleanup --- Examples/AspNetCoreExample/Program.cs | 2 +- SlackNet/Default.cs | 2 +- SlackNet/SlackRtmClient.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/AspNetCoreExample/Program.cs b/Examples/AspNetCoreExample/Program.cs index 99cfde31..8c6109fb 100644 --- a/Examples/AspNetCoreExample/Program.cs +++ b/Examples/AspNetCoreExample/Program.cs @@ -4,7 +4,7 @@ var builder = WebApplication.CreateBuilder(args); -var slackSettings = builder.Configuration.GetSection("Slack").Get(); +var slackSettings = builder.Configuration.GetSection("Slack").Get()!; builder.Services.AddSlackNet(c => c // Configure the tokens used to authenticate with Slack diff --git a/SlackNet/Default.cs b/SlackNet/Default.cs index 567cc347..a5b0a79e 100644 --- a/SlackNet/Default.cs +++ b/SlackNet/Default.cs @@ -49,7 +49,7 @@ private static JsonSerializerSettings SerializerSettings(ISlackTypeResolver slac public static ISlackTypeResolver SlackTypeResolver(params Assembly[] assembliesContainingSlackTypes) => new SlackTypeResolver(assembliesContainingSlackTypes); - public static Assembly[] AssembliesContainingSlackTypes => new[] { typeof(Default).GetTypeInfo().Assembly }; + public static Assembly[] AssembliesContainingSlackTypes => [typeof(Default).GetTypeInfo().Assembly]; public static IWebSocketFactory WebSocketFactory => new WebSocketFactory(); diff --git a/SlackNet/SlackRtmClient.cs b/SlackNet/SlackRtmClient.cs index 31da00ae..c91b0038 100644 --- a/SlackNet/SlackRtmClient.cs +++ b/SlackNet/SlackRtmClient.cs @@ -144,9 +144,9 @@ await _webSocket.Connect( /// /// Is the client connecting or has it connected. /// - public bool Connected => - _webSocket?.State == WebSocketState.Connecting - || _webSocket?.State == WebSocketState.Open; + public bool Connected => _webSocket?.State + is WebSocketState.Connecting + or WebSocketState.Open; /// /// Send a simple message. For more complicated messages, use instead.