mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: For NIO's 'promise leak detector' we added file:line: labels to makePromise and there it makes sense. A user might create a promise and then never fulfil it, bad. With the file:line: arguments we can give good diagnostics. However, we (probably that @weissi again) also added it to flatMap and friends where it doesn't make sense at all. Sure, EventLoopFuture's implementation may create a promise in the implementation of flatMap but this promise is never leaked unless the previous future is never fulfilled (or NIO has a terrible bug). Suffice to say that in a future chain, it's never a flatMap etc which is responsible for leaking the first promise... Explain here the context, and why you're making that change. What is the problem you're trying to solve. Modifications: Remove all unnecessary `file:line:` parameters whilst keeping the public API intact. Result: More sensible code.