Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: lib/src/result/capture_transformer.dart

Issue 2996143002: Add methods to Result. Bump version to 2.0 and remove deprecated features. (Closed)
Patch Set: Address comments, run dartfmt on tests too. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/result/capture_sink.dart ('k') | lib/src/result/error.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/result/capture_transformer.dart
diff --git a/lib/src/result/capture_transformer.dart b/lib/src/result/capture_transformer.dart
index 6b1bbf239cd24e9efb8de5fa0a68015412f9583a..71e8a002b715cc831125f0f1d0dc76008eba878b 100644
--- a/lib/src/result/capture_transformer.dart
+++ b/lib/src/result/capture_transformer.dart
@@ -4,14 +4,13 @@
import 'dart:async';
-import '../result.dart';
+import 'result.dart';
import 'capture_sink.dart';
/// A stream transformer that captures a stream of events into [Result]s.
///
/// The result of the transformation is a stream of [Result] values and no
-/// error events. This is the transformer used by [captureStream].
-@Deprecated("Will be removed in async 2.0.0.")
+/// error events. Exposed by [Result.captureStream].
class CaptureStreamTransformer<T> implements StreamTransformer<T, Result<T>> {
const CaptureStreamTransformer();
@@ -19,7 +18,6 @@ class CaptureStreamTransformer<T> implements StreamTransformer<T, Result<T>> {
return new Stream<Result<T>>.eventTransformed(source, _createSink);
}
- static EventSink _createSink(EventSink<Result> sink) {
- return new CaptureSink(sink);
- }
+ // Since Stream.eventTransformed is not generic, this method can be static.
+ static EventSink _createSink(EventSink<Result> sink) => new CaptureSink(sink);
}
« no previous file with comments | « lib/src/result/capture_sink.dart ('k') | lib/src/result/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698