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

Function filter

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected