MCPcopy Create free account
hub / github.com/docknetwork/crypto / basic

Function basic

utils/src/extend_some.rs:62–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61 #[test]
62 fn basic() {
63 let ExtendSome::<Vec<_>>(arr) = [Some(1), Some(2), None, Some(4)].into_iter().collect();
64
65 assert_eq!(arr, [1, 2, 4]);
66
67 let (ExtendSome::<Vec<_>>(even), ExtendSome::<Vec<_>>(odd)) =
68 [Some(1), Some(2), None, Some(4), Some(5), None]
69 .into_iter()
70 .partition(|v| v.map_or(false, |idx| idx % 2 == 0));
71
72 assert_eq!(even, vec![2, 4]);
73 assert_eq!(odd, vec![1, 5])
74 }
75}

Callers

nothing calls this directly

Calls 1

into_iterMethod · 0.45

Tested by

no test coverage detected