MCPcopy Create free account
hub / github.com/RustCrypto/utils / zip_with

Function zip_with

ctutils/src/ct_option.rs:907–915  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

905
906 #[test]
907 fn zip_with() {
908 assert!(NONE.zip_with(NONE, |a, b| a + b).is_none().to_bool());
909 assert!(NONE.zip_with(SOME, |a, b| a + b).is_none().to_bool());
910 assert!(SOME.zip_with(NONE, |a, b| a + b).is_none().to_bool());
911 assert_eq!(
912 SOME.zip_with(OTHER, |a, b| a + b).unwrap(),
913 SOME.unwrap() + OTHER.unwrap()
914 );
915 }
916}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected