Created
June 28, 2025 21:17
-
-
Save freedomtowin/14507de79321e301be1f8009cddd4736 to your computer and use it in GitHub Desktop.
Example of creating a Gist using Python
This file contains hidden or 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
use my_proc_macros_lib::comp; | |
pub fn test_list_compreh() { | |
let vec_of_vecs = vec![vec![1, 2, 3], vec![4, 5, 6]]; | |
let result = comp![x for vec in vec_of_vecs for x in vec if x > 1 && x < 6].collect::<Vec<_>>(); | |
println!("{:?}", result); | |
assert_eq!(result, [2, 3, 4, 5]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment