From 86344ef93f16bc21725de8b301991994dabc9869 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Thu, 7 Nov 2019 08:08:45 -0800 Subject: [PATCH] trivial refactor in sparse fieldset file --- Sources/JSONAPI/SparseFields/SparseFieldset.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Sources/JSONAPI/SparseFields/SparseFieldset.swift b/Sources/JSONAPI/SparseFields/SparseFieldset.swift index b326f13..f7fca89 100644 --- a/Sources/JSONAPI/SparseFields/SparseFieldset.swift +++ b/Sources/JSONAPI/SparseFields/SparseFieldset.swift @@ -36,15 +36,12 @@ public struct SparseFieldset< public extension ResourceObject where Description.Attributes: SparsableAttributes { + /// The `SparseFieldset` type for this `ResourceObject` + typealias SparseType = SparseFieldset + /// Get a Sparse Fieldset of this `ResourceObject` that can be encoded /// as a `SparsePrimaryResource`. - func sparse(with fields: [Description.Attributes.CodingKeys]) -> SparseFieldset { + func sparse(with fields: [Description.Attributes.CodingKeys]) -> SparseType { return SparseFieldset(self, fields: fields) } } - -public extension ResourceObject where Description.Attributes: SparsableAttributes { - - /// The `SparseFieldset` type for this `ResourceObject` - typealias SparseType = SparseFieldset -}