Skip to content

Commit

Permalink
Fix misleading comment on ELF.map (#1012)
Browse files Browse the repository at this point in the history
Motivation:

We left a doc comment on EventLoopFuture.map that caused confusion by
misleadingly claiming that it could handle throwing functions. The
operation that handles throwing functions is flatMapThrowing.

Modifications:

- Removed the misleading comment and pointed users to flatMapThrowing
    instead.

Result:

Less user confusion.
  • Loading branch information
Lukasa authored and weissi committed May 21, 2019
1 parent a836b78 commit 925ab65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/NIO/EventLoopFuture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ extension EventLoopFuture {
///
/// Operations performed in `map` should not block, or they will block the entire event
/// loop. `map` is intended for use when you have a data-driven function that performs
/// a simple data transformation that can potentially error.
/// a simple data transformation that cannot error.
///
/// If you have a data-driven function that can throw, you should use `flatMapThrowing`
/// instead.
///
/// ```
/// let future1 = eventually()
Expand Down

0 comments on commit 925ab65

Please sign in to comment.