11using System . Buffers ;
2- using System . Diagnostics . CodeAnalysis ;
32using System . Text ;
43using Yamlify . Core ;
54
@@ -420,8 +419,7 @@ public static async Task SerializeAsync<TValue>(
420419 /// <param name="reader">The reader to read from.</param>
421420 /// <param name="typeInfo">The source-generated type info for the target type.</param>
422421 /// <returns>A <typeparamref name="TValue"/> representation of the YAML value.</returns>
423- [ return : MaybeNull ]
424- public static TValue Deserialize < TValue > ( ref Utf8YamlReader reader , YamlTypeInfo < TValue > typeInfo )
422+ public static TValue ? Deserialize < TValue > ( ref Utf8YamlReader reader , YamlTypeInfo < TValue > typeInfo )
425423 {
426424 ArgumentNullException . ThrowIfNull ( typeInfo ) ;
427425 return DeserializeCore ( ref reader , typeInfo ) ;
@@ -440,8 +438,7 @@ public static TValue Deserialize<TValue>(ref Utf8YamlReader reader, YamlTypeInfo
440438 /// <exception cref="InvalidOperationException">
441439 /// Thrown when no TypeInfoResolver is configured on <see cref="YamlSerializerOptions.Default"/>.
442440 /// </exception>
443- [ return : MaybeNull ]
444- public static TValue Deserialize < TValue > ( Stream stream )
441+ public static TValue ? Deserialize < TValue > ( Stream stream )
445442 {
446443 ArgumentNullException . ThrowIfNull ( stream ) ;
447444 var options = YamlSerializerOptions . Default ;
@@ -457,8 +454,7 @@ public static TValue Deserialize<TValue>(Stream stream)
457454 /// <param name="stream">The stream to read from.</param>
458455 /// <param name="typeInfo">The source-generated type info for the target type.</param>
459456 /// <returns>A <typeparamref name="TValue"/> representation of the YAML value.</returns>
460- [ return : MaybeNull ]
461- public static TValue Deserialize < TValue > ( Stream stream , YamlTypeInfo < TValue > typeInfo )
457+ public static TValue ? Deserialize < TValue > ( Stream stream , YamlTypeInfo < TValue > typeInfo )
462458 {
463459 ArgumentNullException . ThrowIfNull ( stream ) ;
464460 ArgumentNullException . ThrowIfNull ( typeInfo ) ;
@@ -478,8 +474,7 @@ public static TValue Deserialize<TValue>(Stream stream, YamlTypeInfo<TValue> typ
478474 /// <exception cref="InvalidOperationException">
479475 /// Thrown when no TypeInfoResolver is configured on the options.
480476 /// </exception>
481- [ return : MaybeNull ]
482- public static TValue Deserialize < TValue > ( Stream stream , YamlSerializerOptions options )
477+ public static TValue ? Deserialize < TValue > ( Stream stream , YamlSerializerOptions options )
483478 {
484479 ArgumentNullException . ThrowIfNull ( stream ) ;
485480 ArgumentNullException . ThrowIfNull ( options ) ;
@@ -498,8 +493,7 @@ public static TValue Deserialize<TValue>(Stream stream, YamlSerializerOptions op
498493 /// <exception cref="InvalidOperationException">
499494 /// Thrown when no TypeInfoResolver is configured on <see cref="YamlSerializerOptions.Default"/>.
500495 /// </exception>
501- [ return : MaybeNull ]
502- public static async ValueTask < TValue > DeserializeAsync < TValue > (
496+ public static async ValueTask < TValue ? > DeserializeAsync < TValue > (
503497 Stream stream ,
504498 CancellationToken cancellationToken = default )
505499 {
@@ -518,8 +512,7 @@ public static async ValueTask<TValue> DeserializeAsync<TValue>(
518512 /// <param name="typeInfo">The source-generated type info for the target type.</param>
519513 /// <param name="cancellationToken">A cancellation token.</param>
520514 /// <returns>A <typeparamref name="TValue"/> representation of the YAML value.</returns>
521- [ return : MaybeNull ]
522- public static async ValueTask < TValue > DeserializeAsync < TValue > (
515+ public static async ValueTask < TValue ? > DeserializeAsync < TValue > (
523516 Stream stream ,
524517 YamlTypeInfo < TValue > typeInfo ,
525518 CancellationToken cancellationToken = default )
0 commit comments