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

Function insert_if

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

Source from the content-addressed store, hash-verified

809
810 #[test]
811 fn insert_if() {
812 let mut example = NONE;
813 assert!(example.is_none().to_bool());
814
815 example.insert_if(&42, Choice::FALSE);
816 assert!(example.is_none().to_bool());
817
818 example.insert_if(&42, Choice::TRUE);
819 assert_eq!(example.unwrap(), 42);
820 }
821
822 #[test]
823 fn map() {

Callers

nothing calls this directly

Calls 1

insert_ifMethod · 0.80

Tested by

no test coverage detected