A little renaming and easier access to important types under the JSONAPIDocument protocol

This commit is contained in:
Mathew Polzin
2018-11-27 18:20:01 -08:00
parent e36180c9b9
commit 661ff6eca5
3 changed files with 32 additions and 19 deletions
@@ -47,3 +47,13 @@ if case let .data(bodyData) = peopleResponse.body {
} else {
print("no body data")
}
// MARK: - Work in the abstract
func process<T: JSONAPIDocument>(document: T) {
guard case let .data(body) = document.body else {
return
}
let x: T.BodyData = body
}
process(document: peopleResponse)