Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing return to fix analysis #62

Merged
merged 3 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.9.7+11

* Fix an analysis hint.

# 0.9.7+10

* Set max SDK version to `<3.0.0`, and adjust other dependencies.
Expand Down
3 changes: 2 additions & 1 deletion lib/src/async_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ class AsyncQueue<T> {
/// the process was cancelled.
Future _processNextItem() {
var item = _items.removeFirst();
return _processor(item).then((_) {
return _processor(item).then((_) async {
if (_items.isNotEmpty) return _processNextItem();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the method is async, this should be return await. Otherwise it's easy to accidentally refactor without realizing this is asynchronous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


// We have drained the queue, stop processing and wait until something
// has been enqueued.
_isProcessing = false;
return await null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the other return should be return await. There's no use in awaiting null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed that, fixed.

});
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: watcher
version: 0.9.7+10
version: 0.9.7+11

description: >
A file system watcher. It monitors changes to contents of directories and
Expand Down