From fdbe41d77f0d77d8ee07e12271c132973efdea6c Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 19 May 2016 00:05:45 -0300 Subject: [PATCH] Fixed a couple Optional errors --- src/Discord.Net/API/Optional.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net/API/Optional.cs b/src/Discord.Net/API/Optional.cs index 0fe96071c..b828608b2 100644 --- a/src/Discord.Net/API/Optional.cs +++ b/src/Discord.Net/API/Optional.cs @@ -9,7 +9,7 @@ namespace Discord.API { private readonly T _value; - /// Gets the value for this paramter, or default(T) if unspecified. + /// Gets the value for this paramter. public T Value { get @@ -22,8 +22,6 @@ namespace Discord.API /// Returns true if this value has been specified. public bool IsSpecified { get; } - object IOptional.Value => _value; - /// Creates a new Parameter with the provided value. public Optional(T value) { @@ -40,12 +38,14 @@ namespace Discord.API if (other == null) return false; return _value.Equals(other); } - public override int GetHashCode() => IsSpecified ? _value.GetHashCode() : 0; + public override string ToString() => IsSpecified ? _value?.ToString() : null; private string DebuggerDisplay => IsSpecified ? _value.ToString() : ""; public static implicit operator Optional(T value) => new Optional(value); public static explicit operator T(Optional value) => value.Value; + + object IOptional.Value => Value; } }