From 5640eae01f98cc6d695ddebcbe9b2e1511a19eca Mon Sep 17 00:00:00 2001 From: Alex Deem Date: Thu, 13 Jun 2024 08:23:05 +1000 Subject: [PATCH] Add sequence initialiser --- Sources/ScreamURITemplate/VariableProvider.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/ScreamURITemplate/VariableProvider.swift b/Sources/ScreamURITemplate/VariableProvider.swift index 7a18efc..fe1677b 100644 --- a/Sources/ScreamURITemplate/VariableProvider.swift +++ b/Sources/ScreamURITemplate/VariableProvider.swift @@ -32,8 +32,12 @@ extension TypedVariableDictionary: TypedVariableProvider {} public struct SequenceVariableProvider: VariableProvider, ExpressibleByArrayLiteral { let sequence: any Sequence + public init(sequence: any Sequence) { + self.sequence = sequence + } + public init(arrayLiteral elements: VariableProvider...) { - sequence = elements + self.init(sequence: elements) } public subscript(_ name: String) -> VariableValue? {