Skip to content

Commit

Permalink
Drop use of pkg:collection whereNotNull() (dart-archive/async#278)
Browse files Browse the repository at this point in the history
Exists in SDK as of v3.0
  • Loading branch information
kevmoo authored Jun 17, 2024
1 parent 9af10ab commit 9383a3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions pkgs/async/lib/src/cancelable_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import 'dart:async';

import 'package:collection/collection.dart';

/// An asynchronous operation that can be cancelled.
///
/// The value of this operation is exposed as [value]. When this operation is
Expand Down Expand Up @@ -521,7 +519,7 @@ class CancelableCompleter<T> {
final isFuture = toReturn is Future;
final cancelFutures = <Future<Object?>>[
if (isFuture) toReturn,
...?_cancelForwarders?.map(_forward).whereNotNull()
...?_cancelForwarders?.map(_forward).nonNulls
];
final results = (isFuture && cancelFutures.length == 1)
? [await toReturn]
Expand Down
4 changes: 1 addition & 3 deletions pkgs/async/lib/src/stream_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import 'dart:async';

import 'package:collection/collection.dart';

/// A collection of streams whose events are unified and sent through a central
/// stream.
///
Expand Down Expand Up @@ -239,7 +237,7 @@ class StreamGroup<T> implements Sink<Stream<T>> {
return null;
}
})
.whereNotNull()
.nonNulls
.toList();

_subscriptions.clear();
Expand Down
2 changes: 1 addition & 1 deletion pkgs/async/lib/src/stream_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'dart:async';
import 'dart:collection';

import 'package:collection/collection.dart';
import 'package:collection/collection.dart' show QueueList;

import 'cancelable_operation.dart';
import 'result/result.dart';
Expand Down

0 comments on commit 9383a3c

Please sign in to comment.