-
Notifications
You must be signed in to change notification settings - Fork 59
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
Return Nullable instead of Optional<T> #395
Comments
There are drop-in-replacement for standard optional class, it can be activated like this:
and in app/build.gradle I have
In theory you can patch jni-include.rs like this:
|
Okay thanks I'll try it out |
Can I just put the path in the |
In theory you should be able to rewrite any standard rule that defined in jni-include.rs in your file.rs.in . But looks like rewriting generic rule contains some bug, |
Okay sure |
I've recently ran into the same problem, the drop-in-replacement solved the issue but I had to use
Due to the |
Is there way to return a nullable value instead of a value wrapped in
Optional<T>
?The difficulty is
Optional<T>
works with Andriod Api Version 24+ (but my projects starts from Api 21) and since the main language for andriod programming is Kotlin, it would be better to use Kotlin's way of handling nullable values i.e. using?
operator among othersA possible solution would be to rewrite the Optional class in Java (since Kotlin's
companion object
s are different from Java'sstatic
keyword), preserving the parts I'd use, but I feel using the Kotlin syntax integrates more with my projectThe text was updated successfully, but these errors were encountered: