3 ms·
In kotlin your example would be: fun process_item(input: Item?) -> Item? { input?.plus(3) } This would have to be modified in rust to apply to both
by pirocks 6y ago
In kotlin your example would be:
fun process_item(input: Item?) -> Item? {
input?.plus(3)
}
This would have to be modified in rust to apply to both error and option types, as well as working on stuff other than the . operator, but I think it could be made to work.
The main difference is that the ?. operator in kotlin works at the expression level, instead of the function level.