From 19466c0daf9138ab20877f34dbcf4479b31d33d6 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 7 Jun 2023 16:48:48 -0700 Subject: [PATCH] Require Dart 3.0, update lints (#74) --- .github/workflows/test-package.yml | 2 +- CHANGELOG.md | 2 +- analysis_options.yaml | 1 + lib/src/chunked_coding/decoder.dart | 8 -------- pubspec.yaml | 4 ++-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index ff779ee..13d2250 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - sdk: [2.17.0, dev] + sdk: [3.0.0, dev] steps: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f856f9..4f9e2a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 4.0.3-dev -* Require Dart 2.17 +* Require Dart 3.0 ## 4.0.2 diff --git a/analysis_options.yaml b/analysis_options.yaml index a18a7f7..fc4afe3 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -33,6 +33,7 @@ linter: - prefer_relative_imports - test_types_in_equals - unnecessary_await_in_return + - unnecessary_breaks - use_if_null_to_convert_nulls_to_bools - use_raw_strings - use_string_buffers diff --git a/lib/src/chunked_coding/decoder.dart b/lib/src/chunked_coding/decoder.dart index ac22c1b..5388ae1 100644 --- a/lib/src/chunked_coding/decoder.dart +++ b/lib/src/chunked_coding/decoder.dart @@ -88,7 +88,6 @@ class _Sink extends ByteConversionSinkBase { _size = _digitForByte(bytes, start); _state = _State.size; start++; - break; case _State.size: if (bytes[start] == $cr) { @@ -99,13 +98,11 @@ class _Sink extends ByteConversionSinkBase { _size = (_size << 4) + _digitForByte(bytes, start); } start++; - break; case _State.sizeBeforeLF: assertCurrentChar($lf, 'LF'); _state = _size == 0 ? _State.endBeforeCR : _State.body; start++; - break; case _State.body: final chunkEnd = math.min(end, start + _size); @@ -113,31 +110,26 @@ class _Sink extends ByteConversionSinkBase { _size -= chunkEnd - start; start = chunkEnd; if (_size == 0) _state = _State.bodyBeforeCR; - break; case _State.bodyBeforeCR: assertCurrentChar($cr, 'CR'); _state = _State.bodyBeforeLF; start++; - break; case _State.bodyBeforeLF: assertCurrentChar($lf, 'LF'); _state = _State.boundary; start++; - break; case _State.endBeforeCR: assertCurrentChar($cr, 'CR'); _state = _State.endBeforeLF; start++; - break; case _State.endBeforeLF: assertCurrentChar($lf, 'LF'); _state = _State.end; start++; - break; case _State.end: throw FormatException('Expected no more data.', bytes, start); diff --git a/pubspec.yaml b/pubspec.yaml index 4e349b1..951b82f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: >- repository: https://github.com/dart-lang/http_parser environment: - sdk: '>=2.17.0 <3.0.0' + sdk: ^3.0.0 dependencies: collection: ^1.15.0 @@ -14,5 +14,5 @@ dependencies: typed_data: ^1.3.0 dev_dependencies: - dart_flutter_team_lints: ^0.1.0 + dart_flutter_team_lints: ^1.0.0 test: ^1.16.0