1 2 3 4 5 6 7 8 9 10 11 12
use std::any::Any; use crate::Mock; pub trait MockTimes: Mock { fn times<T: Any, U: Any>(&'static self, times: u8, expect: fn(T) -> U) -> &'static Self { for _ in 0..times { self.expect(expect); } self } }