Serializer

- Cleaned up

Deserializer

- Cleaned up
This commit is contained in:
Tristan B. Velloza Kildaire 2023-06-28 16:44:00 +02:00
parent b66c7741af
commit c0bd2d624e
2 changed files with 13 additions and 8 deletions

View File

@ -280,15 +280,18 @@ unittest
}
version(unittest)
{
import std.string : cmp;
import std.stdio : writeln;
}
/**
* Another example deserialization of JSON
* to our `Person` struct
*/
unittest
{
import std.string : cmp;
import std.stdio : writeln;
struct Person
{
public string firstname, lastname;
@ -347,7 +350,6 @@ unittest
try
{
Person person = fromJSON!(Person)(json);
import std.stdio : writeln;
writeln(person);
assert(true);
}

View File

@ -87,16 +87,19 @@ private enum EnumType
CAT
}
version(unittest)
{
import std.algorithm.searching : canFind;
import std.string : cmp;
import std.stdio : writeln;
}
/**
* Example serialization of our struct
* `Person` to JSON
*/
unittest
{
import std.algorithm.searching : canFind;
import std.string : cmp;
import std.stdio : writeln;
struct Person
{
public string firstname, lastname;