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

View File

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