-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Arrow-kt dependency #7335
Conversation
@Throws | ||
fun writeToFile(data: ByteArray, file: File) { | ||
file.sink().buffer().use { | ||
it.write(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those 2 fun are actually not used, but I do not want to delete this file.
I think we should get rid of Arrow as it's just used for some Option. We have our own simple Optional type in the sdk, could we replace? |
…il.Optional` instead.
8d3c1db
to
1669316
Compare
OK, I have removed this dep. Thanks to review again the PR! |
fun getOrNull(): T? { | ||
return value | ||
} | ||
fun orNull(): T? = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a new alias to avoid to many changes.
@@ -33,23 +31,19 @@ data class Optional<T : Any> constructor(private val value: T?) { | |||
} | |||
} | |||
|
|||
fun getOrElse(fn: () -> T): T { | |||
fun orElse(fn: () -> T): T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not used at the moment)
} | ||
} | ||
|
||
fun <T : Any> T?.toOption() = Optional(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(another new alias)
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, LGTM
Remove Arrow-kt dependency.
Type of change
Content
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist