Make _LinuxDirectoryWatcher._listen generic (#45)
diff --git a/lib/src/directory_watcher/linux.dart b/lib/src/directory_watcher/linux.dart
index 717e420..354ddc0 100644
--- a/lib/src/directory_watcher/linux.dart
+++ b/lib/src/directory_watcher/linux.dart
@@ -127,8 +127,7 @@
}
/// The callback that's run when a batch of changes comes in.
- void _onBatch(Object data) {
- var batch = data as List<FileSystemEvent>;
+ void _onBatch(List<FileSystemEvent> batch) {
var files = new Set<String>();
var dirs = new Set<String>();
var changed = new Set<String>();
@@ -251,7 +250,7 @@
/// Like [Stream.listen], but automatically adds the subscription to
/// [_subscriptions] so that it can be canceled when [close] is called.
- void _listen(Stream stream, void onData(event),
+ void _listen<T>(Stream<T> stream, void onData(T event),
{Function onError, void onDone(), bool cancelOnError}) {
var subscription;
subscription = stream.listen(onData, onError: onError, onDone: () {