Fix newly enforced package:pedantic lints (#348)

- always_declare_return_types
- use_function_type_syntax_for_parameters
diff --git a/example/main.dart b/example/main.dart
index 13f996f..e53008f 100644
--- a/example/main.dart
+++ b/example/main.dart
@@ -1,7 +1,7 @@
 import 'dart:convert' as convert;
 import 'package:http/http.dart' as http;
 
-main(List<String> arguments) async {
+void main(List<String> arguments) async {
   // This example uses the Google Books API to search for books about http.
   // https://developers.google.com/books/docs/overview
   var url = 'https://www.googleapis.com/books/v1/volumes?q={http}';
diff --git a/lib/http.dart b/lib/http.dart
index bb4dd73..c7dc9bf 100644
--- a/lib/http.dart
+++ b/lib/http.dart
@@ -160,7 +160,7 @@
 Future<Uint8List> readBytes(url, {Map<String, String> headers}) =>
     _withClient((client) => client.readBytes(url, headers: headers));
 
-Future<T> _withClient<T>(Future<T> fn(Client client)) async {
+Future<T> _withClient<T>(Future<T> Function(Client) fn) async {
   var client = Client();
   try {
     return await fn(client);
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index f24994e..9d0648e 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -69,7 +69,7 @@
 ///
 /// The return value, also a single-subscription [Stream] should be used in
 /// place of [stream] after calling this method.
-Stream<T> onDone<T>(Stream<T> stream, void onDone()) =>
+Stream<T> onDone<T>(Stream<T> stream, void Function() onDone) =>
     stream.transform(StreamTransformer.fromHandlers(handleDone: (sink) {
       sink.close();
       onDone();
diff --git a/test/io/http_test.dart b/test/io/http_test.dart
index ac96010..bfd5216 100644
--- a/test/io/http_test.dart
+++ b/test/io/http_test.dart
@@ -9,7 +9,7 @@
 
 import 'utils.dart';
 
-main() {
+void main() {
   group('http.', () {
     setUp(startServer);