Skip to content

Commit

Permalink
Remove unnecessary precondition checks.
Browse files Browse the repository at this point in the history
The public constructors prevent the object from being in this state.

Signed-off-by: Bradley Grainger <[email protected]>
  • Loading branch information
bgrainger committed Dec 16, 2023
1 parent a72a079 commit 87d0dbd
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/HealthChecks.MySql/MySqlHealthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ public class MySqlHealthCheck : IHealthCheck
public MySqlHealthCheck(MySqlHealthCheckOptions options)
{
Guard.ThrowIfNull(options);
if (options.DataSource is null && options.ConnectionString is null)
throw new InvalidOperationException("One of options.DataSource or options.ConnectionString must be specified.");
if (options.DataSource is not null && options.ConnectionString is not null)
throw new InvalidOperationException("Only one of options.DataSource or options.ConnectionString must be specified.");
_options = options;
}

Expand Down

0 comments on commit 87d0dbd

Please sign in to comment.