From 2d285d8f7a045893661468e9beaabec97b6360cb Mon Sep 17 00:00:00 2001 From: Alexander Wiedemann Date: Fri, 12 Apr 2024 11:45:10 +0200 Subject: [PATCH] expression bodies --- Source/FunicularSwitch/Option.cs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Source/FunicularSwitch/Option.cs b/Source/FunicularSwitch/Option.cs index e9b6cb7..66610c2 100644 --- a/Source/FunicularSwitch/Option.cs +++ b/Source/FunicularSwitch/Option.cs @@ -112,15 +112,9 @@ public async Task Match(Func> some, TResult n public override string ToString() => Match(v => v?.ToString() ?? "", () => $"None {typeof(T).BeautifulName()}"); - public bool Equals(Option other) - { - return _isSome == other._isSome && EqualityComparer.Default.Equals(_value, other._value); - } + public bool Equals(Option other) => _isSome == other._isSome && EqualityComparer.Default.Equals(_value, other._value); - public override bool Equals(object? obj) - { - return obj is Option other && Equals(other); - } + public override bool Equals(object? obj) => obj is Option other && Equals(other); public override int GetHashCode() { @@ -130,15 +124,9 @@ public override int GetHashCode() } } - public static bool operator ==(Option left, Option right) - { - return left.Equals(right); - } + public static bool operator ==(Option left, Option right) => left.Equals(right); - public static bool operator !=(Option left, Option right) - { - return !left.Equals(right); - } + public static bool operator !=(Option left, Option right) => !left.Equals(right); } public static class OptionExtension