We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5660789 commit 66db2a2Copy full SHA for 66db2a2
src/main/java/travelator/EmailAddress.kt
@@ -13,8 +13,8 @@ data class EmailAddress(
13
return emailAddress(value, value.lastIndexOf('@'))
14
}
15
16
- private fun emailAddress(value: String, atIndex: Int): EmailAddress {
17
- return if ((atIndex < 1 || atIndex == value.length - 1)) {
+ private fun emailAddress(value: String, atIndex: Int): EmailAddress =
+ if ((atIndex < 1 || atIndex == value.length - 1)) {
18
throw IllegalArgumentException(
19
"EmailAddress must be two parts separated by @"
20
)
@@ -24,6 +24,5 @@ data class EmailAddress(
24
value.substring(atIndex + 1)
25
26
27
- }
28
29
0 commit comments