mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add MustUseReturnValue to copy-over methods
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Serialization.Manager.Result;
|
||||
using Robust.Shared.Serialization.Markdown;
|
||||
using Robust.Shared.Serialization.Markdown.Validation;
|
||||
@@ -158,6 +159,7 @@ namespace Robust.Shared.Serialization.Manager
|
||||
/// This object is not necessarily the same instance as the one passed
|
||||
/// as <see cref="target"/>.
|
||||
/// </returns>
|
||||
[MustUseReturnValue]
|
||||
object? Copy(object? source, object? target, ISerializationContext? context = null, bool skipHook = false);
|
||||
|
||||
/// <summary>
|
||||
@@ -174,6 +176,7 @@ namespace Robust.Shared.Serialization.Manager
|
||||
/// This object is not necessarily the same instance as the one passed
|
||||
/// as <see cref="target"/>.
|
||||
/// </returns>
|
||||
[MustUseReturnValue]
|
||||
T? Copy<T>(T? source, T? target, ISerializationContext? context = null, bool skipHook = false);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Reflection;
|
||||
@@ -520,11 +521,13 @@ namespace Robust.Shared.Serialization.Manager
|
||||
return target;
|
||||
}
|
||||
|
||||
[MustUseReturnValue]
|
||||
public object? Copy(object? source, object? target, ISerializationContext? context = null, bool skipHook = false)
|
||||
{
|
||||
return CopyToTarget(source, target, context, skipHook);
|
||||
}
|
||||
|
||||
[MustUseReturnValue]
|
||||
public T? Copy<T>(T? source, T? target, ISerializationContext? context = null, bool skipHook = false)
|
||||
{
|
||||
var copy = CopyToTarget(source, target, context, skipHook);
|
||||
|
||||
Reference in New Issue
Block a user