From 499831cd267983c3cac5fabd944491c7a0fb28c9 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Wed, 21 Dec 2016 14:14:18 +0900 Subject: [PATCH] Change `Pair` to generic --- Sources/Yams/Node.swift | 10 +++++----- Sources/Yams/Parser.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Yams/Node.swift b/Sources/Yams/Node.swift index c14cbe2..d687919 100644 --- a/Sources/Yams/Node.swift +++ b/Sources/Yams/Node.swift @@ -10,15 +10,15 @@ import Foundation public enum Node { case scalar(String, Tag) - case mapping([Pair], Tag) + case mapping([Pair], Tag) case sequence([Node], Tag) } -public struct Pair: Equatable { - let key: Node - let value: Node +public struct Pair: Equatable { + let key: Value + let value: Value - init(_ key: Node, _ value: Node) { + init(_ key: Value, _ value: Value) { self.key = key self.value = value } diff --git a/Sources/Yams/Parser.swift b/Sources/Yams/Parser.swift index 4e5f2bb..bb66a49 100644 --- a/Sources/Yams/Parser.swift +++ b/Sources/Yams/Parser.swift @@ -167,7 +167,7 @@ extension Parser { } private func loadMapping(from firstEvent: Event) throws -> Node { - var pairs = [Pair]() + var pairs = [Pair]() var event = try parse() while event.type != YAML_MAPPING_END_EVENT { let key = try loadNode(from: event)