How to Return Null Value
The Rust Programming Language Forum
How to Return Null Value
In the following code, returning the None value causes the compiler to throw an error regarding an Option being used while it expected an &str. I have changed it to return an empty string via a match-block, but I require the target variable to be completely omitted if the string is empty rather than containing "-h". How can a null value of sorts be used in this situation? // match-block let cert_type = match host_flag { Some(_) => "-h", None => "", }; // Target variable to ignore if v...
0 comments
No comments yet.