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

Unified Diff: lib/src/utils.dart

Issue 2068363002: pkg/test: Resolve a number of analyzer warnings (Closed) Base URL: https://github.com/dart-lang/test.git@master
Patch Set: nits Created 4 years, 6 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/util/io.dart ('k') | test/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index bc5a2701e9dbe16aff2b2c337f36061191cf9f71..4dccea6e76a90f70f83032ccf811906e80dd2789 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -27,8 +27,12 @@ typedef AsyncFunction();
/// A typedef for a zero-argument callback function.
typedef void Callback();
-/// A converter that decodes bytes using UTF-8 and splits them on newlines.
-final lineSplitter = UTF8.decoder.fuse(const LineSplitter());
+/// A transformer that decodes bytes using UTF-8 and splits them on newlines.
+final StreamTransformer<List<int>, String> lineSplitter = new StreamTransformer(
nweiz 2016/06/23 22:22:47 You can probably avoid type-annotating this, too,
kevmoo 2016/06/23 22:32:28 Just putting types on the right seems to do the tr
+ (Stream<List<int>> stream, bool cancelOnError) => stream
nweiz 2016/06/23 22:22:47 Don't type-annotate these. They should be inferred
kevmoo 2016/06/23 22:32:28 Done.
+ .transform(UTF8.decoder)
+ .transform(const LineSplitter())
+ .listen(null, cancelOnError: cancelOnError));
/// A regular expression to match the exception prefix that some exceptions'
/// [Object.toString] values contain.
« no previous file with comments | « lib/src/util/io.dart ('k') | test/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698