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

Function zip_with

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected