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

Function filter

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

Source from the content-addressed store, hash-verified

780
781 #[test]
782 fn filter() {
783 assert!(NONE.filter(|_| Choice::TRUE).ct_eq(&NONE).to_bool());
784 assert!(NONE.filter(|_| Choice::FALSE).ct_eq(&NONE).to_bool());
785 assert!(SOME.filter(|_| Choice::FALSE).ct_eq(&NONE).to_bool());
786
787 let ret = SOME.filter(|&value| {
788 assert_eq!(VALUE, value);
789 Choice::TRUE
790 });
791 assert_eq!(ret.unwrap(), VALUE);
792 }
793
794 #[test]
795 fn filter_by() {

Callers

nothing calls this directly

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected