option extra
1.0.0
常见标准类型的其他公用事业,令人失望。
新方法生活在OptionExt / ResultExt特征中:
use option_extra :: OptionExt ;
assert_eq ! ( Some ( 1 ) . zip_lazy ( || Some ( "abcd" ) ) , Some ( ( 1 , "abcd" ) ) ) ; use option_extra :: ResultExt ;
assert ! ( Ok :: <_ , ( ) > ( 1 ) . satisfies ( | & n| n % 2 == 1 ) ) ; 如果您想在此库中添加一些东西,请在“创意频道”中提交公关或讨论!