From 47dc736cce70be8f8e7ee7175f3bbafb8efa5ec7 Mon Sep 17 00:00:00 2001 From: Marvin Willms Date: Wed, 31 Jan 2024 02:36:37 +0100 Subject: [PATCH] chore: use `first` instead of `[0]` --- lib/src/cli/command/log_sub_command.dart | 2 +- test/functional_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/cli/command/log_sub_command.dart b/lib/src/cli/command/log_sub_command.dart index ab53175..6645bf6 100644 --- a/lib/src/cli/command/log_sub_command.dart +++ b/lib/src/cli/command/log_sub_command.dart @@ -21,7 +21,7 @@ class LogSubCommand extends CiderCommand { @override Future exec(Project project) async { - await project.addUnreleased(type.name, argResults!.rest[0]); + await project.addUnreleased(type.name, argResults!.rest.first); return 0; } diff --git a/test/functional_test.dart b/test/functional_test.dart index e35fc82..7174222 100644 --- a/test/functional_test.dart +++ b/test/functional_test.dart @@ -237,7 +237,7 @@ I love my dog. test('incorrect usage', () async { final code = await run(['bump']); expect(code, 64); - expect(err.buffer.toString().trim().split('\n')[0], + expect(err.buffer.toString().trim().split('\n').first, 'Usage: cider bump [arguments]'); }); test('help usage', () async { @@ -253,7 +253,7 @@ I love my dog. test('incorrect usage', () async { final code = await run(['log']); expect(code, 64); - expect(err.buffer.toString().trim().split('\n')[0], + expect(err.buffer.toString().trim().split('\n').first, 'Usage: cider log [arguments]'); }); test('help usage', () async {