Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #![crate_type="lib"]
  2.  
  3. pub fn test(x: Option<usize>) -> usize {
  4. match x {
  5. Some(0) | Some(1) | Some(2) => {
  6. 0
  7. },
  8. Some(_) => {
  9. 1
  10. }
  11. None => {
  12. 2
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement