Add a Result.Log() method to aid in debugging

This commit is contained in:
Alex Barney 2019-08-27 12:27:07 -05:00
parent cb705c5f0f
commit d610d2262b

View file

@ -32,6 +32,17 @@ namespace LibHac
} }
} }
/// <summary>
/// A function that can contain code for logging or debugging returned results.
/// Intended to be used when returning a non-zero Result:
/// <code>return result.Log();</code>
/// </summary>
/// <returns>The called <see cref="Result"/> value.</returns>
public Result Log()
{
return this;
}
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return obj is Result result && Equals(result); return obj is Result result && Equals(result);