From c0117d1f0b531e27618bb855a269316fd9a8b213 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Tue, 7 Feb 2023 02:31:43 +0000 Subject: [PATCH] Added `ToString` method for `Mutability` struct (#220) --- src/Global.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Global.cs b/src/Global.cs index 95fc880..8925b98 100644 --- a/src/Global.cs +++ b/src/Global.cs @@ -50,6 +50,17 @@ public override int GetHashCode() return Value.GetHashCode(); } + /// + public override string ToString() + { + return Value switch + { + 0 => nameof(Immutable), + 1 => nameof(Mutable), + _ => throw new ArgumentOutOfRangeException() + }; + } + /// /// Compare a to b and return true if they are equal ///