// Copyright (c) 2022 bradson // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. using System.Globalization; using System.Runtime.CompilerServices; namespace FisheryLib; public static class Convert { [Obsolete("Renamed to Convert.Type for clarity")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TTo To(TFrom from) => Type(from); [Obsolete("Renamed to Convert.Type for clarity")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TTo To(TFrom from, IFormatProvider provider) => Type(from, provider); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe TTo Type(TFrom from) => FunctionPointers.Convert.To.Default(from, CultureInfo.InvariantCulture); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe TTo Type(TFrom from, IFormatProvider provider) => FunctionPointers.Convert.To.Default(from, provider); }