fn alias_for_long_type() {
    type Thunk = Box<dyn Fn() + Send + 'static>;

    let f: Thunk = Box::new(|| println!("hi"));

    fn takes_long_type(f: Thunk) {}

    fn returns_long_type() -> Thunk {
        // --snip--
        Box::new(|| ())
    }
}
// Introducing a type alias "Thunk" to reduce repetition.
Introducing a type alias "Thunk" to reduce repetition.
Introducing a type alias " Thunk " to reduce repetition .
fn alias_for_long_type() {
    type Thunk = Box<dyn Fn() + Send + 'static>;
    let f: Thunk = Box::new(|| println!("hi"));
    fn takes_long_type(f: Thunk) {}
    fn returns_long_type() -> Thunk {
        // --snip--
        Box::new(|| ())
    }
}
fn alias_for_long_type ( ) { type Thunk = Box < dyn Fn ( ) + Send + ' static > ; let f : Thunk = Box :: new ( | | println ! ( " " ) ) ; fn takes_long_type ( f : Thunk ) { } fn returns_long_type ( ) -> Thunk { // --snip-- Box :: new ( | | ( ) ) } }
Introducing a type alias "Thunk" to reduce repetition.
Introducing a type alias " Thunk " to reduce repetition .