What does this Cow example print, and how many heap allocations of the string data occur in process()?
use std::borrow::Cow;
fn process(input: &str) -> Cow<str> {
if input.contains(' ') {
Cow::Owned(input.replace(' ', "_"))
} else {
Cow::Borrowed(input)
}
}
fn main() {
let a = process("no_spaces");
let b = process("has a space");
println!("{} {}", a, b);
}