Merge pull request #166 from Herringway/safe-dump

make Dumper.dump @safe
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-06-16 06:41:04 +02:00 committed by GitHub
commit f2f8ae2a9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
{ {