Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I pass to the .success() for `Result<Void, Error>`? [duplicate]

Tags:

ios

swift

swift5

I have a network request, but I don't really care about the success response, so I use a Result<Void, Error> for return value. The problem is when I assign .success() to it, the compiler return the following error:

Missing argument for parameter #1 in call

I have tried passing empty, nil, but neither can pass the compiling.

The code is like this:

var result: Result<Void, Error>?
result = .success()

How can I make it work?

like image 346
Yiming Dong Avatar asked Jul 12 '19 09:07

Yiming Dong


1 Answers

result = .success(()) should work

like image 193
SchrgCat Avatar answered Nov 03 '22 00:11

SchrgCat