Let's say I have some variable which is optional and in function. I would like to return something in function if the passing argument is null, but otherwise go with the function logic like this:
if(foo == null) return;
// function logic here
}
rather than:
if(foo) |val| {
// function logic here
}
}
The problem with first is if I want to use another function which requires u8 then I'm getting type error. Is there any way to do with first method and don't get type errors when compiling?