2 // pretty-expanded FIXME #23616
4 pub trait Promisable: Send + Sync {}
5 impl<T: Send + Sync> Promisable for T {}
7 pub fn propagate<'a, T, E, F, G>(mut action: F)
8 -> Box<dyn FnMut(Result<T, E>) -> Result<T, E> + 'a>
10 T: Promisable + Clone + 'a,
11 E: Promisable + Clone + 'a,
12 F: FnMut(&T) -> Result<T, E> + Send + 'a,
13 G: FnMut(Result<T, E>) -> Result<T, E> + 'a {
14 Box::new(move |result: Result<T, E>| {
16 Ok(ref t) => action(t),
17 Err(ref e) => Err(e.clone()),