pub fn demonstrate_cow(_point: &BJustClonePoint)
Cow type can wrap around other types and make them "reusable".
Note that the body of this function is identical with that of the body of the example below.
We'll reuse the
Cow::Owned requires that the
underlying type implement
let a_point = Cow::Owned(BJustClonePoint::origin()); demonstrate_cow(&a_point);
Note that even though
demonstrate_cow takes a reference to
BJustClonePoint, we can pass it the
Cow instance; this is where the
Deref implementation on
Cow comes in handy.