From 1153c43fc0cfe23a20008df7f69b9d163974dbd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Overg=C3=A5rd=20Nielsen?= Date: Thu, 18 Apr 2024 11:09:17 +0200 Subject: [PATCH] Simplify with switch expression --- packages/realm_common/lib/src/realm_types.dart | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/realm_common/lib/src/realm_types.dart b/packages/realm_common/lib/src/realm_types.dart index bc9304b67..48ab76ebf 100644 --- a/packages/realm_common/lib/src/realm_types.dart +++ b/packages/realm_common/lib/src/realm_types.dart @@ -85,18 +85,12 @@ enum RealmCollectionType { _3, // ignore: unused_field, constant_identifier_names map; - String get plural { - switch (this) { - case RealmCollectionType.list: - return "lists"; - case RealmCollectionType.set: - return "sets"; - case RealmCollectionType.map: - return "maps"; - default: - return "none"; - } - } + String get plural => switch (this) { + RealmCollectionType.list => 'lists', + RealmCollectionType.set => 'sets', + RealmCollectionType.map => 'maps', + _ => 'none' + }; } /// A base class of all Realm errors.