23 ms·
You should be using the methods on the URL struct to compose a URL, rather than string interpolation. You wouldn't use string interpolation or concatenation to
by eschaton 9y ago
You should be using the methods on the URL struct to compose a URL, rather than string interpolation. You wouldn't use string interpolation or concatenation to compose an SQL query, would you?
- rudedogg 9y agoWhat's the advantage of using URL versus strings? The networking libraries I've worked with just use string interpolation: https://github.com/Moya/Moya/blob/master/docs/Targets.md https://github.com/Moya/Moya/blob/master/docs/Targets.md https://github.com/Alamofire/Alamofire#routing-requests https://github.com/Alamofire/Alamofire#routing-requests
- dep_b 9y agoActually it's behaviour seemed to be geared more towards debugging than actual string formatting. The expected behaviour should be either a compile error, or the value when it's set and nothing, nil or None if it would be allowed to compile.