         return string(from: event.data.scalar.anchor)
     }
     var scalarTag: String? {
-        return (event.data.scalar.plain_implicit != 0 || event.data.scalar.quoted_implicit != 0)
-            ? nil : string(from: event.data.scalar.tag)
+        guard event.data.scalar.plain_implicit == 0,
+            event.data.scalar.quoted_implicit == 0 else {
+                return nil
+        }
+        return string(from: event.data.scalar.tag)
     }
     var scalarValue: String {
         // scalar may contain NULL characters

    /// - Throws: ParserError or YamlError
    public func nextRoot() throws -> Node? {
        if streamEndProduced { return nil }
        switch try expectNextEvent(is: [YAML_DOCUMENT_START_EVENT, YAML_STREAM_END_EVENT]) {
        case YAML_DOCUMENT_START_EVENT:
            let node = try loadNode(from: parse())
            try expectNextEvent(is: [YAML_DOCUMENT_END_EVENT])
            return node
        default: // YAML_STREAM_END_EVENT
            return nil

            yaml_parser_set_input_string(&parser, input, bytes.count - 1)
        }
#endif
        try expectNextEvent(oneOf: [YAML_STREAM_START_EVENT])
    }

    deinit {
