Skip to content

Commit 9383a3c

Browse files
authored
Drop use of pkg:collection whereNotNull() (dart-archive/async#278)
Exists in SDK as of v3.0
1 parent 9af10ab commit 9383a3c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

pkgs/async/lib/src/cancelable_operation.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import 'dart:async';
66

7-
import 'package:collection/collection.dart';
8-
97
/// An asynchronous operation that can be cancelled.
108
///
119
/// The value of this operation is exposed as [value]. When this operation is
@@ -521,7 +519,7 @@ class CancelableCompleter<T> {
521519
final isFuture = toReturn is Future;
522520
final cancelFutures = <Future<Object?>>[
523521
if (isFuture) toReturn,
524-
...?_cancelForwarders?.map(_forward).whereNotNull()
522+
...?_cancelForwarders?.map(_forward).nonNulls
525523
];
526524
final results = (isFuture && cancelFutures.length == 1)
527525
? [await toReturn]

pkgs/async/lib/src/stream_group.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import 'dart:async';
66

7-
import 'package:collection/collection.dart';
8-
97
/// A collection of streams whose events are unified and sent through a central
108
/// stream.
119
///
@@ -239,7 +237,7 @@ class StreamGroup<T> implements Sink<Stream<T>> {
239237
return null;
240238
}
241239
})
242-
.whereNotNull()
240+
.nonNulls
243241
.toList();
244242

245243
_subscriptions.clear();

pkgs/async/lib/src/stream_queue.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import 'dart:async';
66
import 'dart:collection';
77

8-
import 'package:collection/collection.dart';
8+
import 'package:collection/collection.dart' show QueueList;
99

1010
import 'cancelable_operation.dart';
1111
import 'result/result.dart';

0 commit comments

Comments
 (0)