make Dumper.dump @safe

This commit is contained in:
Cameron Ross 2018-06-15 19:22:41 -03:00
parent aee64a5161
commit ea956da667
No known key found for this signature in database
GPG key ID: 777897D98DC91C54

View file

@ -239,12 +239,12 @@ struct Dumper
* Throws: YAMLException on error (e.g. invalid nodes, * Throws: YAMLException on error (e.g. invalid nodes,
* unable to write to file/stream). * unable to write to file/stream).
*/ */
void dump(Node[] documents ...) @trusted void dump(Node[] documents ...) @safe
{ {
try try
{ {
auto emitter = Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_); auto emitter = new Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_);
auto serializer = Serializer(&emitter, resolver_, encoding_, explicitStart_, auto serializer = Serializer(emitter, resolver_, encoding_, explicitStart_,
explicitEnd_, YAMLVersion_, tags_); explicitEnd_, YAMLVersion_, tags_);
foreach(ref document; documents) foreach(ref document; documents)
{ {