diff --git a/bench/bench.csproj b/bench/bench.csproj index b8ea385..c5a530c 100644 --- a/bench/bench.csproj +++ b/bench/bench.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net8.0 enable enable false diff --git a/src/reader/MsgPackReader.IDeserializeType.cs b/src/reader/MsgPackReader.IDeserializeType.cs index d261d89..9242f35 100644 --- a/src/reader/MsgPackReader.IDeserializeType.cs +++ b/src/reader/MsgPackReader.IDeserializeType.cs @@ -13,61 +13,32 @@ private struct DeserializeType(MsgPackReader deserializer) : IDeseriali char IDeserializeType.ReadChar(int index) => (char)deserializer.ReadU16(); - decimal IDeserializeType.ReadDecimal(int index) - { - throw new NotImplementedException(); - } + decimal IDeserializeType.ReadDecimal(int index) => deserializer.ReadDecimal(); + double IDeserializeType.ReadDouble(int index) => deserializer.ReadDouble(); - double IDeserializeType.ReadDouble(int index) - { - throw new NotImplementedException(); - } + float IDeserializeType.ReadFloat(int index) => deserializer.ReadFloat(); - float IDeserializeType.ReadFloat(int index) - { - throw new NotImplementedException(); - } - - short IDeserializeType.ReadI16(int index) - { - throw new NotImplementedException(); - } + short IDeserializeType.ReadI16(int index) => deserializer.ReadI16(); int IDeserializeType.ReadI32(int index) => deserializer.ReadI32(); long IDeserializeType.ReadI64(int index) => deserializer.ReadI64(); - sbyte IDeserializeType.ReadSByte(int index) - { - throw new NotImplementedException(); - } + sbyte IDeserializeType.ReadSByte(int index) => deserializer.ReadSByte(); string IDeserializeType.ReadString(int index) => deserializer.ReadString(); - ushort IDeserializeType.ReadU16(int index) - { - throw new NotImplementedException(); - } + ushort IDeserializeType.ReadU16(int index) => deserializer.ReadU16(); - uint IDeserializeType.ReadU32(int index) - { - throw new NotImplementedException(); - } + uint IDeserializeType.ReadU32(int index) => deserializer.ReadU32(); - ulong IDeserializeType.ReadU64(int index) - { - throw new NotImplementedException(); - } + ulong IDeserializeType.ReadU64(int index) => deserializer.ReadU64(); T IDeserializeType.ReadValue(int index, Serde.IDeserialize deserialize) - { - throw new NotImplementedException(); - } + => deserialize.Deserialize(deserializer); void IDeserializeType.SkipValue() - { - throw new NotImplementedException(); - } + => throw new NotImplementedException(); int IDeserializeType.TryReadIndex(ISerdeInfo map, out string? errorName) { diff --git a/src/reader/MsgPackReader.cs b/src/reader/MsgPackReader.cs index 277afb1..d14bda5 100644 --- a/src/reader/MsgPackReader.cs +++ b/src/reader/MsgPackReader.cs @@ -170,7 +170,7 @@ IDeserializeCollection IDeserializer.ReadCollection(ISerdeInfo typeInfo) } } - decimal IDeserializer.ReadDecimal() + public decimal ReadDecimal() { throw new NotImplementedException(); } @@ -250,7 +250,7 @@ private bool TryReadI16(out short i16) return false; } - short IDeserializer.ReadI16() + public short ReadI16() { if (!TryReadI16(out var i16)) { @@ -335,7 +335,7 @@ private long ReadI64() return proxy.Deserialize(this); } - sbyte IDeserializer.ReadSByte() + public sbyte ReadSByte() { if (!TryReadSbyte(out var sb)) { @@ -490,7 +490,7 @@ private bool TryReadU64(out ulong u64) return false; } - uint IDeserializer.ReadU32() + public uint ReadU32() { if (!TryReadU32(out var u32)) { @@ -499,7 +499,7 @@ uint IDeserializer.ReadU32() return u32; } - ulong IDeserializer.ReadU64() + public ulong ReadU64() { if (!TryReadU64(out var u64)) { diff --git a/tests/Serde.MsgPack.Tests.csproj b/tests/Serde.MsgPack.Tests.csproj index 5103982..250e0ed 100644 --- a/tests/Serde.MsgPack.Tests.csproj +++ b/tests/Serde.MsgPack.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net8.0 enable enable false