From 99d231842f18e4c7da81014ddb638e1eed83287f Mon Sep 17 00:00:00 2001 From: Iskandar Abudiab Date: Sat, 3 Apr 2021 00:43:36 +0200 Subject: [PATCH] Use expected formatting in templates --- templates/model/AnyKubernetesAPIResource.swift.stencil | 2 +- .../model/GroupVersionKind+KubernetesAPIResource.swift.stencil | 2 +- templates/model/Resource.swift.stencil | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/model/AnyKubernetesAPIResource.swift.stencil b/templates/model/AnyKubernetesAPIResource.swift.stencil index 2e6e6eb..420561d 100644 --- a/templates/model/AnyKubernetesAPIResource.swift.stencil +++ b/templates/model/AnyKubernetesAPIResource.swift.stencil @@ -80,7 +80,7 @@ public struct AnyKubernetesAPIResource: KubernetesAPIResource { switch gvk { {% for gvk in allGVK %} case .{{ gvk|GVK.case }}: - decoded = try {{ gvk|GVK.type }}.init(from: decoder){% endfor %} + decoded = try {{ gvk|GVK.type }}(from: decoder){% endfor %} default: let context = DecodingError.Context( codingPath: [CodingKeys.apiVersion, CodingKeys.kind], diff --git a/templates/model/GroupVersionKind+KubernetesAPIResource.swift.stencil b/templates/model/GroupVersionKind+KubernetesAPIResource.swift.stencil index 378a0cf..0a97ea8 100644 --- a/templates/model/GroupVersionKind+KubernetesAPIResource.swift.stencil +++ b/templates/model/GroupVersionKind+KubernetesAPIResource.swift.stencil @@ -27,7 +27,7 @@ public extension GroupVersionKind { /// /// - Parameter resource: An instance of a `KubernetesAPIResource` init?(of resource: R) { - if let gvk = GroupVersionKind.init(rawValue: "\(resource.apiVersion)/\(resource.kind)") { + if let gvk = GroupVersionKind(rawValue: "\(resource.apiVersion)/\(resource.kind)") { self = gvk } else { return nil diff --git a/templates/model/Resource.swift.stencil b/templates/model/Resource.swift.stencil index 38184b8..067007a 100644 --- a/templates/model/Resource.swift.stencil +++ b/templates/model/Resource.swift.stencil @@ -96,7 +96,7 @@ extension {{ type.group }}.{{ type.version }}.{{ type.kind }}: Sequence { public typealias Element = {{ type.group }}.{{ type.version }}.{{ type.listItemKind }} public func makeIterator() -> AnyIterator<{{ type.group }}.{{ type.version }}.{{ type.listItemKind }}> { - AnyIterator(self.items.makeIterator()) + AnyIterator(items.makeIterator()) } } {% endif %}