From e3f271fc6fd4242fc0be503911ee9e434bd5820e Mon Sep 17 00:00:00 2001 From: Zsolt Varadi Date: Fri, 22 Feb 2019 23:13:43 +0100 Subject: [PATCH] Use the Request's privateContainer to store the options --- Sources/CurlyClient/CurlyClient.swift | 2 +- Sources/CurlyClient/CurlyOption+Private.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CurlyClient/CurlyClient.swift b/Sources/CurlyClient/CurlyClient.swift index d9c8220..d12d9fd 100644 --- a/Sources/CurlyClient/CurlyClient.swift +++ b/Sources/CurlyClient/CurlyClient.swift @@ -52,7 +52,7 @@ private extension CURLRequest { return } - if let storage = try? req.make(CurlyOptionStorage.self) { + if let storage = req.storage { storage.options.forEach { $0.curlOption.forEach { self.options.append($0) } } diff --git a/Sources/CurlyClient/CurlyOption+Private.swift b/Sources/CurlyClient/CurlyOption+Private.swift index 4efa23a..005b256 100644 --- a/Sources/CurlyClient/CurlyOption+Private.swift +++ b/Sources/CurlyClient/CurlyOption+Private.swift @@ -7,7 +7,7 @@ class CurlyOptionStorage: Service { extension Request { var storage: CurlyOptionStorage? { get { - return try? make(CurlyOptionStorage.self) + return try? privateContainer.make(CurlyOptionStorage.self) } } }