make Composer fully @safe to use

This commit is contained in:
Cameron Ross 2018-04-22 18:37:22 -03:00
parent 636f87ad6d
commit e316c91643
No known key found for this signature in database
GPG key ID: 777897D98DC91C54

View file

@ -116,7 +116,7 @@ final class Composer
}
///Get single YAML document, throwing if there is more than one document.
Node getSingleNode() @trusted
Node getSingleNode() @safe
{
assert(!parser_.checkEvent(EventID.StreamEnd),
"Trying to get a node from Composer when there is no node to " ~
@ -142,7 +142,7 @@ final class Composer
///Params: pairAppenderLevel = Current level in the pair appender stack.
/// nodeAppenderLevel = Current level the node appender stack.
void ensureAppendersExist(const uint pairAppenderLevel, const uint nodeAppenderLevel)
@trusted
@safe
{
while(pairAppenders_.length <= pairAppenderLevel)
{
@ -155,7 +155,7 @@ final class Composer
}
///Compose a YAML document and return its root node.
Node composeDocument() @trusted
Node composeDocument() @safe
{
//Drop the DOCUMENT-START event.
parser_.getEvent();