Created
December 25, 2022 19:12
-
-
Save lucperkins/4410e5c8ecdf87f29ef4c806c9bba671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn get_or_none<T>(items: Vec<T>) -> Option<Vec<T>> { | |
if items.is_empty() { | |
None | |
} else { | |
Some(items) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment