Skip to content

Commit aceed1c

Browse files
committed
Restructured code into better suited namespaces
1 parent bbeb438 commit aceed1c

17 files changed

Lines changed: 29 additions & 28 deletions

DotNetExtensions/Collections/Combinations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DotNetExtensions;
1+
namespace DotNetExtensions.Collections;
22

33
public static partial class EnumerableExtensions
44
{

DotNetExtensions/Collections/DictionaryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
namespace DotNetExtensions;
5+
namespace DotNetExtensions.Collections;
66

77
/// <summary>
88
/// Provides extension methods for working with dictionaries.

DotNetExtensions/Collections/EnumerableExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DotNetExtensions;
1+
namespace DotNetExtensions.Collections;
22

33
/// <summary>
44
/// Provides extension methods for working with enumerable sequences.

DotNetExtensions/Collections/Quintuples.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace DotNetExtensions;
1+
namespace DotNetExtensions.Collections;
22

33
public static partial class EnumerableExtensions
44
{
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System.Runtime.CompilerServices;
22

3-
#pragma warning disable once CS8509 // The switch expression does not handle all possible values of its input type (it is not exhaustive).
4-
5-
namespace DotNetExtensions;
3+
namespace DotNetExtensions.Core;
64

75
/// <summary>
86
/// Provides extension methods for working with enumeration types.
@@ -27,7 +25,9 @@ public static class EnumExtensions
2725
public static bool HasAnyFlag<TEnum>(this TEnum value, TEnum flag) where TEnum : unmanaged, Enum
2826
{
2927
// Since this method covers all possible backing types of the enum, we can safely disable the CS8509 warning.
28+
#pragma warning disable CS8509 // The switch expression does not handle all possible values of its input type (it is not exhaustive).
3029
return Unsafe.SizeOf<TEnum>() switch
30+
#pragma warning restore CS8509 // The switch expression does not handle all possible values of its input type (it is not exhaustive).
3131
{
3232
sizeof(byte) => (Unsafe.As<TEnum, byte>(ref value) & Unsafe.As<TEnum, byte>(ref flag)) != 0,
3333
sizeof(ushort) => (Unsafe.As<TEnum, ushort>(ref value) & Unsafe.As<TEnum, ushort>(ref flag)) != 0,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Numerics;
22

3-
namespace DotNetExtensions;
3+
namespace DotNetExtensions.Core;
44

55
/// <summary>
66
/// Provides extension methods for working with numeric types.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Drawing;
22

3-
namespace DotNetExtensions;
3+
namespace DotNetExtensions.Core;
44

55
/// <summary>
66
/// Provides extension methods for working with <see cref="Point"/> structures.

DotNetExtensions/DotNetExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

8-
<Version>3.0.4</Version>
8+
<Version>5.0.0</Version>
99
<Authors>Diogo Medeiros</Authors>
1010
<Company>Diogo Medeiros</Company>
1111
<Description>This is a collection of extension methods for .NET Core.</Description>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Diagnostics.CodeAnalysis;
22
using System.Numerics;
33

4-
namespace DotNetExtensions;
4+
namespace DotNetExtensions.Utilities;
55

66
public class Accumulator<T> where T : INumber<T>, IMinMaxValue<T>
77
{

DotNetExtensionsTests/Collections/CombinationsTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
using System.Collections.Immutable;
2-
using DotNetExtensions;
2+
using DotNetExtensions.Collections;
33

4-
namespace DotNetExtensionsTests;
4+
namespace DotNetExtensionsTests.Collections;
55

66
public partial class EnumerableExtensionsTests
77
{
88
[TestMethod]
99
public void TestCombinationsWithZeroLength()
1010
{
1111
int[] source = [1, 2, 3, 4, 5];
12-
var result = source.Combinations(0)
12+
var result = source
13+
.Combinations(0)
1314
.Select(x => x.ToImmutableArray())
1415
.ToImmutableArray();
1516

0 commit comments

Comments
 (0)