/// `concat_frobs_from_vec_dynamic2`&mdash;another single concrete function&mdash;introduces
/// the concept of a _box_. Instead of a vector of references, this is now a vector
/// of _values_ each of which is a _owning reference_ to an object implementing
/// the `Frobber` trait. Note that object ownership is distinctly different from
/// the case of `concat_frobs_from_vec_dynamic1` which takes a vector of references.
/// Both functions _consume_ the vector (since it's passed by value). In addition,
/// `concat_frobs_from_vec_dynamic2` also consumes the _objects) themselves since
/// they are owned by the vector.
`concat_frobs_from_vec_dynamic2`—another single concrete function—introduces
the concept of a _box_. Instead of a vector of references, this is now a vector
of _values_ each of which is a _owning reference_ to an object implementing
the `Frobber` trait. Note that object ownership is distinctly different from
the case of `concat_frobs_from_vec_dynamic1` which takes a vector of references.
Both functions _consume_ the vector (since it's passed by value). In addition,
`concat_frobs_from_vec_dynamic2` also consumes the _objects) themselves since
they are owned by the vector.
` concat_frobs_from_vec_dynamic2 ` —another single concrete function—introduces the concept of a _box_ . Instead of a vector of references this is now a vector of _values_ each of which is a _owning reference_ to an object implementing the ` Frobber ` trait . Note that object ownership is distinctly different from the case of ` concat_frobs_from_vec_dynamic1 ` which takes a vector of references . Both functions _consume_ the vector ( since it ' s passed by value ) . In addition ` concat_frobs_from_vec_dynamic2 ` also consumes the _objects ) themselves since they are owned by the vector .
fn concat_frobs_from_vec_dynamic2(frobbers: Vec<Box<dyn Frobber>>) -> String {
    // Probably not the most efficient implementation!
    frobbers
        .iter()
        .map(|frobber| frobber.frob())
        .collect::<Vec<_>>()
        .join(";")
}
fn concat_frobs_from_vec_dynamic2 ( frobbers : Vec < Box < dyn Frobber > > ) -> String { // Probably not the most efficient implementation! frobbers . iter ( ) . map ( | frobber | frobber . frob ( ) ) . collect :: < Vec < _ > > ( ) . join ( " " ) }
`concat_frobs_from_vec_dynamic2`&mdash;another single concrete function&mdash;introduces
the concept of a _box_.
` concat_frobs_from_vec_dynamic2 ` &mdash ; another single concrete function&mdash ; introduces the concept of a _box_ .
frobbers
Vec<Box<dyn Frobber>>