From e360df06eab4f84ca4eb09a97b8ddd8c156f2e20 Mon Sep 17 00:00:00 2001 From: Simon Strandgaard Date: Sat, 2 Dec 2017 18:10:25 +0000 Subject: [PATCH] Fixed 2 compiler warnings of this type: String interpolation produces a debug description for an optional value; did you mean to make this explicit? Use 'String(describing:)' to silence this warning, Provide a default value to avoid this warning --- Sources/main.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/main.swift b/Sources/main.swift index 1529b1e..e4d834e 100755 --- a/Sources/main.swift +++ b/Sources/main.swift @@ -78,7 +78,9 @@ routes.add(method: .get, uri: "/api/v1/check", handler: { var resp = [String: String]() resp["authenticated"] = "AUTHED: \(request.user.authenticated)" - resp["SessionID"] = "SessionID: \(request.user.authDetails?.account.uniqueID)" + + let sessionIdValue: String = String(describing: request.user.authDetails?.account.uniqueID) + resp["SessionID"] = "SessionID: \(sessionIdValue)" do { try response.setBody(json: resp) @@ -96,7 +98,9 @@ routes.add(method: .get, uri: "/api/v1/nocheck", handler: { var resp = [String: String]() resp["authenticated"] = "AUTHED: \(request.user.authenticated)" - resp["authDetails"] = "DETAILS: \(request.user.authDetails)" + + let authDetailsValue: String = String(describing: request.user.authDetails) + resp["authDetails"] = "DETAILS: \(authDetailsValue)" do { try response.setBody(json: resp)