Skip to content

Commit

Permalink
removed unnecessary awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitin-Poojary committed Jul 13, 2023
1 parent 888e7b3 commit f0ef9ee
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions packages/pigeon/lib/pigeon_lib.dart
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class AstGeneratorAdapter implements GeneratorAdapter {

@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async =>
await _openSink(options.astOut, basePath: options.basePath ?? '');
_openSink(options.astOut, basePath: options.basePath ?? '');

@override
List<Error> validate(PigeonOptions options, Root root) => <Error>[];
Expand Down Expand Up @@ -462,7 +462,7 @@ class DartGeneratorAdapter implements GeneratorAdapter {

@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async =>
await _openSink(options.dartOut, basePath: options.basePath ?? '');
_openSink(options.dartOut, basePath: options.basePath ?? '');

@override
List<Error> validate(PigeonOptions options, Root root) => <Error>[];
Expand Down Expand Up @@ -493,8 +493,7 @@ class DartTestGeneratorAdapter implements GeneratorAdapter {
@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async {
if (options.dartTestOut != null) {
return await _openSink(options.dartTestOut,
basePath: options.basePath ?? '');
return _openSink(options.dartTestOut, basePath: options.basePath ?? '');
} else {
return null;
}
Expand Down Expand Up @@ -534,11 +533,9 @@ class ObjcGeneratorAdapter implements GeneratorAdapter {
Future<IOSink?> shouldGenerate(
PigeonOptions options, FileType fileType) async {
if (fileType == FileType.source) {
return await _openSink(options.objcSourceOut,
basePath: options.basePath ?? '');
return _openSink(options.objcSourceOut, basePath: options.basePath ?? '');
} else {
return await _openSink(options.objcHeaderOut,
basePath: options.basePath ?? '');
return _openSink(options.objcHeaderOut, basePath: options.basePath ?? '');
}
}

Expand Down Expand Up @@ -571,7 +568,7 @@ class JavaGeneratorAdapter implements GeneratorAdapter {

@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async =>
await _openSink(options.javaOut, basePath: options.basePath ?? '');
_openSink(options.javaOut, basePath: options.basePath ?? '');

@override
List<Error> validate(PigeonOptions options, Root root) => <Error>[];
Expand Down Expand Up @@ -600,7 +597,7 @@ class SwiftGeneratorAdapter implements GeneratorAdapter {

@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async =>
await _openSink(options.swiftOut, basePath: options.basePath ?? '');
_openSink(options.swiftOut, basePath: options.basePath ?? '');

@override
List<Error> validate(PigeonOptions options, Root root) => <Error>[];
Expand Down Expand Up @@ -636,11 +633,9 @@ class CppGeneratorAdapter implements GeneratorAdapter {
Future<IOSink?> shouldGenerate(
PigeonOptions options, FileType fileType) async {
if (fileType == FileType.source) {
return await _openSink(options.cppSourceOut,
basePath: options.basePath ?? '');
return _openSink(options.cppSourceOut, basePath: options.basePath ?? '');
} else {
return await _openSink(options.cppHeaderOut,
basePath: options.basePath ?? '');
return _openSink(options.cppHeaderOut, basePath: options.basePath ?? '');
}
}

Expand Down Expand Up @@ -673,7 +668,7 @@ class KotlinGeneratorAdapter implements GeneratorAdapter {

@override
Future<IOSink?> shouldGenerate(PigeonOptions options, FileType _) async =>
await _openSink(options.kotlinOut, basePath: options.basePath ?? '');
_openSink(options.kotlinOut, basePath: options.basePath ?? '');

@override
List<Error> validate(PigeonOptions options, Root root) => <Error>[];
Expand Down

0 comments on commit f0ef9ee

Please sign in to comment.