1
0
Эх сурвалжийг харах

Mark some structs as readonly.

Bart De Smet 5 жил өмнө
parent
commit
d2472d4f95

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/Recorded.cs

@@ -17,7 +17,7 @@ namespace Microsoft.Reactive.Testing
 #if !NO_SERIALIZABLE
     [Serializable]
 #endif
-    public struct Recorded<T> : IEquatable<Recorded<T>>
+    public readonly struct Recorded<T> : IEquatable<Recorded<T>>
     {
         private readonly long _time;
         private readonly T _value;

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/Subscription.cs

@@ -15,7 +15,7 @@ namespace Microsoft.Reactive.Testing
 #if !NO_SERIALIZABLE
     [Serializable]
 #endif
-    public struct Subscription : IEquatable<Subscription>
+    public readonly struct Subscription : IEquatable<Subscription>
     {
         /// <summary>
         /// Infinite virtual time value, used to indicate an unsubscription never took place.

+ 1 - 1
Rx.NET/Source/src/System.Reactive/TimeInterval.cs

@@ -15,7 +15,7 @@ namespace System.Reactive
 #if !NO_SERIALIZABLE
     [Serializable]
 #endif
-    public struct TimeInterval<T> : IEquatable<TimeInterval<T>>
+    public readonly struct TimeInterval<T> : IEquatable<TimeInterval<T>>
     {
         /// <summary>
         /// Constructs a time interval value.

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Timestamped.cs

@@ -16,7 +16,7 @@ namespace System.Reactive
     [Serializable]
 #endif
     [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Timestamped", Justification = "Reviewed and agreed upon.")]
-    public struct Timestamped<T> : IEquatable<Timestamped<T>>
+    public readonly struct Timestamped<T> : IEquatable<Timestamped<T>>
     {
         /// <summary>
         /// Constructs a timestamped value.

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Unit.cs

@@ -10,7 +10,7 @@ namespace System.Reactive
 #if !NO_SERIALIZABLE
     [Serializable]
 #endif
-    public struct Unit : IEquatable<Unit>
+    public readonly struct Unit : IEquatable<Unit>
     {
         /// <summary>
         /// Determines whether the specified <see cref="Unit"/> value is equal to the current <see cref="Unit"/>. Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.